snakemake / snakedeploy

deploy a snakemake pipeline directly from version control (under development)
Mozilla Public License 2.0
21 stars 8 forks source link

`snakedeploy pin-conda-envs` hangs forever before deleting temporary output #63

Closed dlaehnemann closed 3 weeks ago

dlaehnemann commented 3 months ago

I have seen the same behavior on a Ubuntu 20.04 machine, so I think it is a rather general bug.

Description

When running:

snakedeploy pin-conda-envs some_environment_definition.yaml

after a little bit of doing something, the process eventually hangs forever, not doing anything any more. Before that point, it does create the expected some_environment_definition.linux-64.pin.txt file, but does not exit and does not delete the temporary folder that it creates. The only way to terminate it, is to kill the process (for example with Ctrl-C), which gives the following traceback:

Traceback (most recent call last):
  File "/home/dlaehnemann/micromamba/envs/snakemake/bin/snakedeploy", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/site-packages/snakedeploy/client.py", line 275, in main
    pin_conda_envs(
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/site-packages/snakedeploy/conda.py", line 35, in pin_conda_envs
    return CondaEnvProcessor(conda_frontend=conda_frontend).process(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/site-packages/snakedeploy/conda.py", line 155, in process
    self.update_pinning(conda_env_path, pr)
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/site-packages/snakedeploy/conda.py", line 294, in update_pinning
    self.exec_conda(f"env remove --prefix {tmpdir}")
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/site-packages/snakedeploy/conda.py", line 297, in exec_conda
    return sp.run(
           ^^^^^^^
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/subprocess.py", line 550, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/subprocess.py", line 1209, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/subprocess.py", line 2115, in _communicate
    ready = selector.select(timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dlaehnemann/micromamba/envs/snakemake/lib/python3.12/selectors.py", line 415, in select
    fd_event_list = self._selector.poll(timeout)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
tdayris commented 2 months ago

Same issue on ubuntu Ubuntu 24.04 LTS. I currently use the same workaround.

johanneskoester commented 1 month ago

No clue what might be wrong there. Seems like the conda env remove process does not properly exit.