Skip to content

nextstrain update conda fails when runtime has not been set up #440

Open

Description

@corneliusroemer
$ nextstrain update conda
Checking for newer versions of Nextstrain CLI…

A new version of nextstrain-cli, 10.2.0, is available!  You're running 9.0.0.

See what's new in the changelog:

    https://github.com/nextstrain/cli/blob/10.2.0/CHANGES.md#readme

Upgrade your Conda-based installation running:

    mamba install -p /Users/cr/micromamba/envs/py12 nextstrain-cli==10.2.0

Updating conda runtime…
Updating Conda package nextstrain-base from None to 20250602T192245Z…

Updating Conda packages in /Users/cr/.nextstrain/runtimes/conda/env…
  - nextstrain-base ==20250602T192245Z
Error running ('/Users/cr/.nextstrain/runtimes/conda/micromamba/bin/micromamba', '--root-prefix', '/Users/cr/.nextstrain/runtimes/conda/micromamba', '--no-rc', '--no-env', '--yes', 'update', 'nextstrain-base ==20250602T192245Z', '--prefix', '/Users/cr/.nextstrain/runtimes/conda/env', '--override-channels', '--strict-channel-priority', '--channel', 'nextstrain', '--channel', 'conda-forge', '--channel', 'bioconda', '--no-py-pin', '--allow-uninstall', '--allow-downgrade')
Traceback (most recent call last):
  File "/Users/cr/micromamba/envs/py12/lib/python3.12/site-packages/nextstrain/cli/runner/conda.py", line 389, in micromamba
    subprocess.run(argv, env = env, check = True)
  File "/Users/cr/micromamba/envs/py12/lib/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cr/micromamba/envs/py12/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/cr/micromamba/envs/py12/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/cr/.nextstrain/runtimes/conda/micromamba/bin/micromamba'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/cr/micromamba/envs/py12/lib/python3.12/site-packages/nextstrain/cli/runner/conda.py", line 529, in update
    micromamba("update", update_spec)
  File "/Users/cr/micromamba/envs/py12/lib/python3.12/site-packages/nextstrain/cli/runner/conda.py", line 391, in micromamba
    raise InternalError(f"Error running {argv!r}") from err
nextstrain.cli.errors.InternalError: Error running ('/Users/cr/.nextstrain/runtimes/conda/micromamba/bin/micromamba', '--root-prefix', '/Users/cr/.nextstrain/runtimes/conda/micromamba', '--no-rc', '--no-env', '--yes', 'update', 'nextstrain-base ==20250602T192245Z', '--prefix', '/Users/cr/.nextstrain/runtimes/conda/env', '--override-channels', '--strict-channel-priority', '--channel', 'nextstrain', '--channel', 'conda-forge', '--channel', 'bioconda', '--no-py-pin', '--allow-uninstall', '--allow-downgrade')

Updating failed!

Maybe upgrading Nextstrain CLI, as noted above, will help?

PR fails due to action timeout, seems like there's a problem with the build:

Activity

  1. added
    bug
    on Jun 4, 2025
  2. joverlee521 commented on Jun 4, 2025

    @joverlee521
    Contributor

    The line Updating Conda package nextstrain-base from None to 20250602T192245Z… and the FileNotFoundError imply that the conda runtime is not set up yet.

    @corneliusroemer Did you already run nextstrain setup conda or try running nextstrain setup conda --force?

  3. victorlin commented on Jul 2, 2025

    @victorlin
    Member

    As @joverlee521 hints, the error is not is due to a missing version of CLI on Bioconda. 10.2.0 is now available on bioconda so I'm going to remove that part from the issue title to avoid confusion.

    I'm able to reproduce the same error with nextstrain update conda from a fresh install of Nextstrain CLI version 9.0.0, so the issue is that nextstrain setup conda has not been run yet. This can be easily detected, and the error message should be improved.

    Note that the error is different on version 10.2.0, though it could also be improved:

    $ nextstrain update conda
    Checking for newer versions of Nextstrain CLI…
    
    nextstrain-cli is up to date!
    
    Updating conda runtime…
    Error running ('/home/codespace/.nextstrain/runtimes/conda/micromamba/bin/micromamba', '--root-prefix', '/home/codespace/.nextstrain/runtimes/conda/micromamba', '--no-rc', '--no-env', '--yes', 'repoquery', 'search', 'nextstrain-base', '--override-channels', '--strict-channel-priority', '--channel', 'https://conda.anaconda.org/nextstrain', '--platform', 'linux-64', '--repodata-ttl', '0', '--json', '--cacert-path', '/tmp/tmpnekcpf9wcacert.pem')
    Updating conda runtime failed!
    
    Some updates failed!  See above for details.
    
  4. changed the title [-]`nextstrain update conda` fails due to cli v10.2.0 not being available via bioconda[/-] [+]`nextstrain update conda` fails when runtime has not been set up[/+] on Jul 2, 2025
  5. victorlin commented on Jul 3, 2025

    @victorlin
    Member

    Oh, I now realize there are 2 issues here, the 2nd one being that the Conda-based installation gives a bad hint:

    Upgrade your Conda-based installation running:
    
        mamba install -p /Users/cr/micromamba/envs/py12 nextstrain-cli==10.2.0
    

    This is because there is a lag between when a new version is detectable (i.e. available in PyPI) and when it can be Conda installed (i.e. Bioconda PR merged and package built). For 10.2.0 this lag was nearly 2 months, but that's a one-off and typically it's a day or two. We could update the latest version detection for Conda-based installations, but I'm not sure it's worth the extra hassle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions