epi2me-labs / kraken2-server

Kraken2 Server
Other
20 stars 3 forks source link

Assertion `seqs_in_flight==0' failed. #4

Closed rmcolq closed 7 months ago

rmcolq commented 7 months ago

I've been running kraken2_server/client within a nextflow pipeline and am repeatedly seeing the following error:

Connecting to server: localhost:8080.
Classifying sequence stream.
Server responded as ready.
Reading sequences from file: Human_GRCh38.all.fastq.gz
Batches: 5 16696
Done waiting
kraken2_client: /tmp/miniconda-uGwM8P6DP0/conda-bld/kraken2-server_1680642040833/work/client/kraken2_client.cc:116: int SequenceClient::ClassifySequences(const std::string&, const std::string&): Assertion `seqs_in_flight==0' failed.
work/ed/3af529ff058ca4e86f88e517cf8871/.command.sh: line 2:    29 Aborted                 (core dumped) kraken2_client --port 8080 --host-ip localhost --report "PlusPF.kraken_report.txt" --sequence Human_GRCh38.all.fastq.gz > "PlusPF.kraken_assignments.tsv"

I started with 50 (simulated) read files, and of these 18 always fail with the above error, regardless of the amount of memory or the number of threads I give to the server or client process (I've tried with lots of threads and with very restricted threading). Same problem when I've tried a few of the latest conda images (from epi2melabs)

Versions: kraken2-server 0.1.7 h2bc3f7f_0 nanoporetech

Server details:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                80
On-line CPU(s) list:   0-79
Thread(s) per core:    2
Core(s) per socket:    20
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Gold 6242R CPU @ 3.10GHz
cjw85 commented 7 months ago

Hi @rmcolq,

What nextflow workflow are you running? Is it our wf-metagenomics? Not that it matters necessarily, the kraken client shouldn't be failing that assertion. The assertion is a book keeping check that all reads have done a round trip between the client and the server. Either its true that that hasn't happened or there is a bug in the book keeping code itself.

I have never myself seen the assertion fail. Would it be possible for you to share your simulated input files and the database provided to the server?

rmcolq commented 7 months ago

It isn't wf-metagenomics it's our own (scylla). Fails with the PlusPF (massive) and Viral (much smaller) databases downloaded from https://benlangmead.github.io/aws-indexes/k2 Fails both run via docker and run directly with the conda install, and run outside of nextflow. My file is too big, so going to check if a smaller version still fails

cjw85 commented 7 months ago

Failing that. Can you reproduce the error outside of the workflow manager using the kraken-client and kraken-server programs directly?

rmcolq commented 7 months ago

small.fastq.gz This one fails for the following bash command:

#!/bin/bash -euo pipefail
kraken2_client         --port 8080 --host-ip localhost         --report "Viral.kraken_report.txt"         --sequence small.fastq.gz > "Viral.kraken_assignments.tsv"

with the server being generated using the following (local, not docker):

#!/bin/bash -euo pipefail
kraken2_server         --max-requests 2 --thread-pool 2        --port 8080         --host-ip localhost         --db ./database_dir/
cjw85 commented 7 months ago

Thanks, I'll take a look.

cjw85 commented 7 months ago

I've reproduced the error and know what to do to fix it.

cjw85 commented 7 months ago

This issue should be fixed in v0.1.8. Containers and conda packages should appear shortly.