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 libmamba Could not set lock" when run commands are piped #1993

Open
yamaton opened this issue Oct 5, 2022 · 5 comments
Open

"error libmamba Could not set lock" when run commands are piped #1993

yamaton opened this issue Oct 5, 2022 · 5 comments
Labels
type::bug Something isn't working

Comments

@yamaton
Copy link

yamaton commented Oct 5, 2022

Issue

When two micromamba run commands are piped, "libmamba Could not set lock" error seems to appear occasionally.

Environment

  • Ubuntu 22.04 LTS on WSL 2
  • micromamba 0.27.0
  • mambaforge (mamba 0.27.0, conda 22.9.0)

Reproduce

Assumes the root prefix is at ~/mambaforge.

mamba create -y -n just-bat -c conda-forge bat
mamba create -y -n just-jq -c conda-forge jq
mamba install -y -c conda-forge micromamba

# just a sample file
wget https://raw.githubusercontent.com/mamba-org/mamba/main/libmamba/tests/repodata_json_cache/test_1.json

# same as
# bat test_1.json | jq . > /dev/null
micromamba run --root-prefix ~/mambaforge --name just-bat bat test_1.json |  \
  micromamba run --root-prefix ~/mambaforge --name just-jq jq . > /dev/null

Repeat the last command multiple times. Then one would start observing the error:

error libmamba Could not set lock (Resource temporarily unavailable)
warning libmamba Cannot lock '/home/yamaton/.mamba/proc'

@wolfv
Copy link
Member

wolfv commented Oct 5, 2022

Thanks for filing this issue! Do you know if this is a new bug or if it was present before?
Will try to fix this asap.

@yamaton
Copy link
Author

yamaton commented Oct 5, 2022

I just investigated quickly; micromamba 0.21.2 does not seem to have the issue, but I could confirm errors since 0.22.0. I tested against the above case as well as bioinformatics tools (minimap2 and samtools) that almost always gave me errors. (EDIT: wording)

@wolfv
Copy link
Member

wolfv commented Oct 5, 2022

Thanks @yamaton for checking. I think this might be related to WSL2 being slightly slower with filesystem operations and therefore we see an error. With the latest micromamba you can disable file locks by adding use_lockfiles: false to your ~/.mambarc file. That might help as a temporary measure.

@yamaton
Copy link
Author

yamaton commented Oct 5, 2022

Thank you @wolfv. Just adding extra information: I could also confirm the issue on a docker container on Ubuntu instance hosted in AWS with EBS. (Specifically, a self-hosted JupyterHub. Maybe it's adding overheads similar to WSL2 filesystem ops?)

@wolfv
Copy link
Member

wolfv commented Oct 5, 2022

EBS is a network drive, right? There might be some delay coming that way. We should definitely look into fixing this on our side! Thanks!

@jonashaag jonashaag added the type::bug Something isn't working label Oct 11, 2022
hmgaudecker added a commit to OpenSourceEconomics/econ-project-templates that referenced this issue Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants