ablab / spades

SPAdes Genome Assembler
http://ablab.github.io/spades/
Other
745 stars 135 forks source link

SPAdes 3.15.3 does not catch linux binary run via WSL2 #838

Closed kapsakcj closed 2 years ago

kapsakcj commented 3 years ago

Description of bug

@asl informed me that SPAdes 3.15.3 checks for running linux binaries run via WSL2 and returns a sensible error message. My quick search through commit history points me here: https://github.com/ablab/spades/commit/0872b68c93367c0699c01b985b5e247a59d96b52

This was news, to me, so I gave it a quick try on WSL2 using a docker container for SPAdes 3.15.3 that I developed, using the SPAdes linux binary. But I encountered a non-intuitive error message and not the error message in the commit linked above. I think I hit an edge case?

Dockerfile here: https://github.com/StaPH-B/docker-builds/blob/master/spades/3.15.3/Dockerfile dockerhub repo here: https://hub.docker.com/r/staphb/spades

Ran this via WSL2 with Ubuntu 20.04.3 installed via Microsoft Store. (this is not reflected in the spades.log. Not sure why, but perhaps because I've upgraded from Ubuntu 16->18->20 on WSL2)

Happy to provide more info if needed.

To reproduce:

$ docker pull staphb/spades:3.15.3

$ docker run --rm -ti staphb/spades:3.15.3

# spades.py --test

spades.log

spades.log

params.txt

params.txt

SPAdes version

3.15.3

Operating System

WSL2, Ubuntu 18

Python Version

2.7.12 (in container)

Method of SPAdes installation

docker container with SPAdes linux binary

No errors reported in spades.log

kapsakcj commented 3 years ago

Github wouldn't let me submit the Issue without checking the box "Yes - No errors reported in spades.log" but there was an error in the logfile.

asl commented 3 years ago

It seems to be a Python 2 vs Python 3 difference. In Python 2 uname() returns tuple, and in Python 3 an object is returned... :(

kapsakcj commented 3 years ago

ah! Good catch. That solved the issue. My docker container needs to be updated to include python3 !

I switched the docker container to use ubuntu:bionic as a base image, installed python3 (3.6.9) & python3-distutils via apt then tried test again. This time I got the helpful error message.

# spades.py --test

== Warning ==  No assembly mode was specified! If you intend to assemble high-coverage multi-cell/isolate data, use '--isolate' option.

Command line: bin/spades.py     --test

System information:
  SPAdes version: 3.15.3
  Python version: 3.6.9
  OS: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-Ubuntu-18.04-bionic

Output dir: /SPAdes-3.15.3-Linux/spades_test
Mode: read error correction and assembling
Debug mode is turned OFF

Dataset parameters:
  Standard mode
  For multi-cell/isolate data we recommend to use '--isolate' option; for single-cell MDA data use '--sc'; for metagenomic data use '--meta'; for RNA-Seq use '--rna'.
  Reads:
    Library number: 1, library type: paired-end
      orientation: fr
      left reads: ['/SPAdes-3.15.3-Linux/share/spades/test_dataset/ecoli_1K_1.fq.gz']
      right reads: ['/SPAdes-3.15.3-Linux/share/spades/test_dataset/ecoli_1K_2.fq.gz']
      interlaced reads: not specified
      single reads: not specified
      merged reads: not specified
Read error correction parameters:
  Iterations: 1
  PHRED offset will be auto-detected
  Corrected reads will be compressed
Assembly parameters:
  k: automatic selection based on read length
  Repeat resolution is enabled
  Mismatch careful mode is turned OFF
  MismatchCorrector will be SKIPPED
  Coverage cutoff is turned OFF
Other parameters:
  Dir for temp files: /SPAdes-3.15.3-Linux/spades_test/tmp
  Threads: 16
  Memory limit (in Gb): 24

======= SPAdes pipeline started. Log can be found here: /SPAdes-3.15.3-Linux/spades_test/spades.log

/SPAdes-3.15.3-Linux/share/spades/test_dataset/ecoli_1K_1.fq.gz: max reads length: 100
/SPAdes-3.15.3-Linux/share/spades/test_dataset/ecoli_1K_2.fq.gz: max reads length: 100

Reads length: 100

===== Before start started.

===== Read error correction started.

===== Read error correction started.

== Running: /SPAdes-3.15.3-Linux/bin/spades-hammer /SPAdes-3.15.3-Linux/spades_test/corrected/configs/config.info

The program was terminated by segmentation fault
=== Stack Trace ===

== Error ==  system call for: "['/SPAdes-3.15.3-Linux/bin/spades-hammer', '/SPAdes-3.15.3-Linux/spades_test/corrected/configs/config.info']" finished abnormally, OS return value: -11
1. WSL is an unsupported platform
2. If SPAdes crashes, then you might want to compile it from sources
3. If nothing works, run on real Linux

In case you have troubles running SPAdes, you can write to spades.support@cab.spbu.ru
or report an issue on our GitHub repository github.com/ablab/spades
Please provide us with params.txt and spades.log files from the output directory.

SPAdes log can be found here: /SPAdes-3.15.3-Linux/spades_test/spades.log

Thank you for using SPAdes!

Please close, this issue is on me!