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

Error: ���� when running in docker #239

Open
multimeric opened this issue Apr 26, 2021 · 9 comments
Open

Error: ���� when running in docker #239

multimeric opened this issue Apr 26, 2021 · 9 comments

Comments

@multimeric
Copy link

multimeric commented Apr 26, 2021

I am running hmmbuild on a Stockholm alignment. My input alignment file has an error, and when I run hmmbuild test.hmm alignment.so, I get:

Error: Oops. Wait. I need name annotation on each alignment in a multi MSA file; failed on #3

This is a helpful error message. However, when I run the exact same command in docker, as part of a nextflow pipeline, I get the error in the title, which is not helpful. I can replicate this afterwards by:

  • Having the problematic Stockholm alignment in the working directory
  • Starting a docker container using docker run -i -v "$PWD":"$PWD" -w "$PWD" --entrypoint /bin/bash -t quay.io/biocontainers/hmmer:3.3.2--h1b792b2_1
  • Running hmmbuild c.hmm combined.so

This results in the following output

# hmmbuild :: profile HMM construction from multiple sequence alignments
# HMMER 3.3.2 (Nov 2020); http://hmmer.org/
# Copyright (C) 2020 Howard Hughes Medical Institute.
# Freely distributed under the BSD open source license.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# input alignment file:             combined.so
# output HMM file:                  c.hmm
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# idx name                  nseq  alen  mlen eff_nseq re/pos description
#---- -------------------- ----- ----- ----- -------- ------ -----------

Error: ����

Initially I thought this might be related to environment variables being set differently in Docker, but I tried to copy the exact some variables from the container using env and I still wasn't able to replicate this error on my local machine.

@npcarter
Copy link
Member

npcarter commented Apr 28, 2021 via email

@multimeric
Copy link
Author

It happens with any file that has multiple MSAs without names. For example:

# STOCKHOLM 1.0

sample_1    ACDFG
sample_2    ACDFG
//

# STOCKHOLM 1.0

sample_3    ACDFG
sample_4    ACDFG
//

Notably it seems like you do actually have to be running bash inside the container for this to happen (as explained above). If you simply docker run -i -v "$PWD":"$PWD" -w "$PWD" --entrypoint hmmbuild -t quay.io/biocontainers/hmmer:3.3.2--h1b792b2_1 f.hmm test.so then the correct error message is displayed.

@npcarter
Copy link
Member

npcarter commented Apr 29, 2021 via email

@npcarter
Copy link
Member

npcarter commented May 4, 2021 via email

@multimeric
Copy link
Author

Great! Thanks for the workaround, I'll add that flag to my docker containers in the short term to help the error messages! As you say, this only happens when running inside bash, in a container. This seems like an unusual use-case, but is actually how many pipeline managers (such as nextflow) run tools, so it's a relevant use case to consider.

Yes it seems that it's tricky to work out if the process is a daemon using the OS utilities, but HMMer must internally know if it's running as a daemon in order to decide when to terminate?

@npcarter
Copy link
Member

npcarter commented May 5, 2021 via email

@multimeric
Copy link
Author

Ah, I see. Could you perhaps use an environment variable based switch, and then set the HMMER_DAEMON_MODE=1 when you fork from the daemon, but if this variable is unset, always print out to stderr?

@cryptogenomicon
Copy link
Member

Nick, could you re-test this issue with our current develop branch? I think I may have just fixed a bug that could have plausibly been causing this issue.

@npcarter
Copy link
Member

npcarter commented May 2, 2023

Just checked this on my Mac, and behavior appears unchanged. I get the mangled error output when I just run the docker image, and the correct output when I run docker with --pid=host.

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

No branches or pull requests

3 participants