kraken2 icon indicating copy to clipboard operation
kraken2 copied to clipboard

xargs: cat: terminated by signal 13

Open kdbchau opened this issue 3 years ago • 9 comments

Using kraken2 version 2.1.2.

My code:

kraken2-build --build --db /scratch/chauk/kraken2/kraken_nt/nt --threads 32

The error (even after trying with different --thread n values):

Sequence ID to taxonomy ID map already present, skipping map creation.
Estimating required capacity (step 2)...
xargs: cat: terminated by signal 13

Have seen this issue posted a few times before but no clear solution/fix.

kdbchau avatar Sep 30 '21 20:09 kdbchau

Have you tried with allocating more memory to run the job?

lynngao avatar Oct 09 '21 19:10 lynngao

How would I do that? I don't see any parameters with kraken2-build that alter memory, aside from maybe--max-db-size

kdbchau avatar Oct 09 '21 23:10 kdbchau

No it's not a parameter in kraken2-build command. You need to allocate the memory to run the command. Something like this #SBATCH --mem=60GB

lynngao avatar Oct 10 '21 02:10 lynngao

I have same issue. Kraken version 2.1.1

kraken2-build --build --db nt --threads 16 'Estimated hash table requirement: 345259953004 bytes' Taxonomy parsed and converted. xargs: cat: terminated by signal 13 ~/apps/Kraken2/build_kraken2_db.sh: line 143: 3284866 Done list_sequence_files 3284867 Exit 125 | xargs -0 cat 3284868 Killed | build_db -k $KRAKEN2_KMER_LEN -l $KRAKEN2_MINIMIZER_LEN -S $KRAKEN2_SEED_TEMPLATE $KRAKEN2XFLAG -H hash.k2d.tmp -t taxo.k2d.tmp -o opts.k2d.tmp -n taxonomy/ -m $seqid2taxid_map_file -c $required_capacity -p $KRAKEN2_THREAD_CT $max_db_flag -B $KRAKEN2_BLOCK_SIZE -b $KRAKEN2_SUBBLOCK_SIZE -r $KRAKEN2_MIN_TAXID_BITS $fast_build_flag I am using a machine with 200GB spare RAM, 6TB of disk space where database is located (But does have other intermittent processes). There is no setting however in the build_kraken2_db.sh parameters (or in build_db.cc that I noticed) that allows setting RAM usage.

As signal 13 refers to "Broken pipe: write to pipe with no readers" any ideas on most likely cause?

bioscienceresearch avatar Oct 23 '21 22:10 bioscienceresearch

I have same issue. Kraken version 2.1.1

kraken2-build --build --db nt --threads 16 'Estimated hash table requirement: 345259953004 bytes' Taxonomy parsed and converted. xargs: cat: terminated by signal 13 ~/apps/Kraken2/build_kraken2_db.sh: line 143: 3284866 Done list_sequence_files 3284867 Exit 125 | xargs -0 cat 3284868 Killed | build_db -k $KRAKEN2_KMER_LEN -l $KRAKEN2_MINIMIZER_LEN -S $KRAKEN2_SEED_TEMPLATE $KRAKEN2XFLAG -H hash.k2d.tmp -t taxo.k2d.tmp -o opts.k2d.tmp -n taxonomy/ -m $seqid2taxid_map_file -c $required_capacity -p $KRAKEN2_THREAD_CT $max_db_flag -B $KRAKEN2_BLOCK_SIZE -b $KRAKEN2_SUBBLOCK_SIZE -r $KRAKEN2_MIN_TAXID_BITS $fast_build_flag I am using a machine with 200GB spare RAM, 6TB of disk space where database is located (But does have other intermittent processes). There is no setting however in the build_kraken2_db.sh parameters (or in build_db.cc that I noticed) that allows setting RAM usage.

As signal 13 refers to "Broken pipe: write to pipe with no readers" any ideas on most likely cause?

It's not a parameter in kraken command. It's when you run your job on high performance cluster, you need to allocate memory to the job.

lynngao avatar Oct 23 '21 22:10 lynngao

I note 345GB requirement and created a 200GB swapfile in addition to RAM. This runs OK but had to kill the process after 5 days as needed the machine for other work

bioscienceresearch avatar Oct 24 '21 02:10 bioscienceresearch

TIL Signal 13 is a broken pipe on the receiving end. In this context, this means that a command (build_kraken2_db.sh?) still sends output, but xargs -0 cat is not there anymore, for whatever reason.

adRn-s avatar Nov 15 '23 15:11 adRn-s

I have same issue. Kraken version 2.1.1 kraken2-build --build --db nt --threads 16 'Estimated hash table requirement: 345259953004 bytes' Taxonomy parsed and converted. xargs: cat: terminated by signal 13 ~/apps/Kraken2/build_kraken2_db.sh: line 143: 3284866 Done list_sequence_files 3284867 Exit 125 | xargs -0 cat 3284868 Killed | build_db -k $KRAKEN2_KMER_LEN -l $KRAKEN2_MINIMIZER_LEN -S $KRAKEN2_SEED_TEMPLATE $KRAKEN2XFLAG -H hash.k2d.tmp -t taxo.k2d.tmp -o opts.k2d.tmp -n taxonomy/ -m $seqid2taxid_map_file -c $required_capacity -p $KRAKEN2_THREAD_CT $max_db_flag -B $KRAKEN2_BLOCK_SIZE -b $KRAKEN2_SUBBLOCK_SIZE -r $KRAKEN2_MIN_TAXID_BITS $fast_build_flag I am using a machine with 200GB spare RAM, 6TB of disk space where database is located (But does have other intermittent processes). There is no setting however in the build_kraken2_db.sh parameters (or in build_db.cc that I noticed) that allows setting RAM usage. As signal 13 refers to "Broken pipe: write to pipe with no readers" any ideas on most likely cause?

It's not a parameter in kraken command. It's when you run your job on high performance cluster, you need to allocate memory to the job.

Hi, It's a very old problem and I'm facing the same problem right now. How do I allocate memory to run the command? I am not familiar with operating on a Linux terminal. Do I have to modify some text file in kraken or do I have to write a bash file? Thank you.

Scott-0208 avatar Jul 24 '24 16:07 Scott-0208

If you don't have enough ram, you can increase the swap. @Scott-0208

I wrote a detailed tutorial on the same here.

https://avilpage.com/2024/07/mastering-kraken2-initial-runs.html

ChillarAnand avatar Jul 30 '24 16:07 ChillarAnand