KneadData critical error in bowtie2_discordant_pairs

I’m running KneadData on a HPC cluster and parallelizing with GNU Parallel. I’m getting an error at the discordant pairs step but the log does not contain any information about what’s causing this. I’ve already fixed the sequence identifiers.

The kneaddata_bowtie2_discordant_pairs step runs by itself and all input files look correct. Is this possibly a RAM issue? I’m running 10 cores with 50 gb RAM per core.

Here is the output from the log:
09/22/2021 03:01:28 PM - kneaddata.utilities - CRITICAL: Error executing: kneaddata_bowtie2_discordant_pairs --bowtie2 /storage/work/epb5360/miniconda3/envs/eukdetect/bin/bowtie2 --threads 1 -x /gpfs/group/evk5387/default/emily/refs/hg37dec_v0.1 --mode strict --bowtie2-options "--very-sensitive-local --phred33" -1 /storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata.trimmed.1.fastq -2 /storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata.trimmed.2.fastq --un-pair /storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata_hg37dec_v0.1_bowtie2_paired_clean_%.fastq --al-pair /storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata_hg37dec_v0.1_bowtie2_paired_contam_%.fastq -U /storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata.trimmed.single.1.fastq,/storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata.trimmed.single.2.fastq --un-single /storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata_hg37dec_v0.1_bowtie2_unmatched_%_clean.fastq --al-single /storage/home/epb5360/scratch/kneaded/sun2018/SRR7721904_rename_1_kneaddata_hg37dec_v0.1_bowtie2_unmatched_%_contam.fastq -S /dev/null

I obtain the same error

Error message returned from bowtie2 :
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “en_IL:en”,
LC_ALL = (unset),
LANG = “en_IL”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
/home/mybiotics/miniconda3/bin/bowtie2-align-s: error while loading shared libraries: cannot open shared object file: No such file or directory
(ERR): Description of arguments failed!
Exiting now …
Unable to run bowtie2:

Have you solved the error executing: kneaddata_bowtie2_discordant_pairs???
I got the same error, and error.log was attached.
Look forward to your reply.
yan-kneaddata-error.log.txt (19.8 KB)

Hi everyone
I ran into the same error, has anyone solved this ?
I am decontaminating two genomes (human + a plant). The log shows the human decontamination worked, but the error happens afterwards, with the plant genome. I supplied the --very-sensitive-local option to bowtie2 via kneaddata. The end of the log (after the error message similar to @EmilyB 's is :

Error message returned from bowtie2 :
87015042 reads; of these:
87015042 (100.00%) were unpaired; of these:
86283017 (99.16%) aligned 0 times
415099 (0.48%) aligned exactly 1 time
316926 (0.36%) aligned >1 times
0.84% overall alignment rate
Traceback (most recent call last):
File “/project/def-ilafores/common/kneaddata/bin/kneaddata_bowtie2_discordant_pairs”, line 8, in
File “/project/def-ilafores/common/kneaddata/lib/python3.7/site-packages/kneaddata/”, line 271, in main
File “/project/def-ilafores/common/kneaddata/lib/python3.7/site-packages/kneaddata/”, line 244, in process_alignments
File “/project/def-ilafores/common/kneaddata/lib/python3.7/site-packages/kneaddata/”, line 164, in organize_alignments_single
for line in file_handle:
OSError: [Errno 5] Input/output error

In case it helps, I built my plant genome index from this assembly :

1 Like

I got the same error, did you manage to solve it?


Hi,I got the same error, did you manage to solve it?
I don’t know if the problem is coming from KneadData or bowtie2?
Look forward to your reply.

Hello, Sorry for the slow response. Is it possible you are running out of disk space?

Thank you,

Hello @Joao-Gatica , Sorry for the slow response. Thank you for posting the detailed error. This error looks like an issue with the perl installation. If you add the shared library “” it should resolve the error.

Thank you,

Hi @EmilyB , Sorry for the slow response. That looks like a good amount of memory. Is it possible you are running out of disk space? If not, can you run the kneaddata_bowtie2_discordant_pairs command directly and see if it provides additional error information?

Thank you,

In my case, the path of bowtie2 was set to different directory with kneaddata installed directory. I fixed with the option --bowtie2 $kneaddata_bowtie2_dir(bin/). It worked well.

I have the same issue. Could you have ever solved this?

I got the same error ,and I ran into another error when I run the bowtie2 again:
Segmentation fault (core dumped)

Having the same issue. Does not seem to be a memory or disk space issue. Any updates?