Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picard cannot write to stdout #630

Open
nh13 opened this issue Aug 17, 2016 · 2 comments
Open

Picard cannot write to stdout #630

nh13 opened this issue Aug 17, 2016 · 2 comments

Comments

@nh13
Copy link
Collaborator

nh13 commented Aug 17, 2016

It looks like it is checking the output for a termination block, but the output is a pipe, so it should never get to BlockCompressedOutputStream.java:286. The command I am using is below.

java -jar build/libs/picard.jar FastqToSam F1=./testdata/picard/sam/fastq2bam/fastq-sanger/5k-30BB2AAXX.3.aligned.sam.fastq O=/dev/stdout SAMPLE_NAME=Name > out.bam
[Tue Aug 16 22:46:27 EDT 2016] picard.sam.FastqToSam FASTQ=./testdata/picard/sam/fastq2bam/fastq-sanger/5k-30BB2AAXX.3.aligned.sam.fastq OUTPUT=/dev/stdout SAMPLE_NAME=Name    USE_SEQUENTIAL_FASTQS=false READ_GROUP_NAME=A SORT_ORDER=queryname MIN_Q=0 MAX_Q=93 STRIP_UNPAIRED_MATE_NUMBER=false ALLOW_AND_IGNORE_EMPTY_LINES=false VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json
[Tue Aug 16 22:46:27 EDT 2016] Executing as nhomer@Nils on Mac OS X 10.11.2 x86_64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b17; Picard version: 2.6.0-7-gd4350fc-SNAPSHOT
INFO    2016-08-16 22:46:27 FastqToSam  Auto-detected quality format as: Standard.
INFO    2016-08-16 22:46:27 FastqToSam  Processed 4952 fastq reads
[Tue Aug 16 22:46:27 EDT 2016] picard.sam.FastqToSam done. Elapsed time: 0.01 minutes.
Runtime.totalMemory()=257425408
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.util.RuntimeIOException: /dev/stdout (Permission denied)
    at htsjdk.samtools.util.BinaryCodec.close(BinaryCodec.java:610)
    at htsjdk.samtools.BAMFileWriter.finish(BAMFileWriter.java:143)
    at htsjdk.samtools.SAMFileWriterImpl.close(SAMFileWriterImpl.java:219)
    at picard.sam.FastqToSam.doWork(FastqToSam.java:290)
    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:208)
    at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95)
    at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
Caused by: java.io.FileNotFoundException: /dev/stdout (Permission denied)
    at java.io.RandomAccessFile.open0(Native Method)
    at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
    at htsjdk.samtools.util.BlockCompressedInputStream.checkTermination(BlockCompressedInputStream.java:471)
    at htsjdk.samtools.util.BlockCompressedOutputStream.close(BlockCompressedOutputStream.java:286)
    at java.io.FilterOutputStream.close(FilterOutputStream.java:159)
    at htsjdk.samtools.util.BinaryCodec.close(BinaryCodec.java:606)
    ... 6 more

Related to fulcrumgenomics/fgbio#64

@nh13 nh13 added the bug label Aug 17, 2016
@nh13
Copy link
Collaborator Author

nh13 commented Jun 16, 2017

As another datapoint, I have another tool that has the same problem.

@nh13
Copy link
Collaborator Author

nh13 commented Jun 16, 2017

samtools/htsjdk#901

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants