TLJH Upgrade fails with Conda and Mamba version errors

Hi, I am trying upgrade TLJH installation, running on Ubuntu LTS but running into incompatible error with Conda v24.11.3 and Mamba v1.5.9

Existing TLJH installation detected, upgrading...
Upgrading pip...
Upgrading TLJH installer...
Running TLJH installer...
Granting passwordless sudo to JupyterHub admins...
Setting up user environment...
Reinstalling conda==24.11.3, mamba==1.5.9 to ensure a consistent environment
Ran /opt/tljh/user/bin/mamba install --yes --force-reinstall -c conda-forge --prefix /opt/tljh/user conda==24.11.3 mamba==1.5.9 with exit code 1
warning  libmamba Could not parse mod/etag header
warning  libmamba Could not parse mod/etag header
conda 24.11.3: overriding channel, version and build from installed packages due to --force-reinstall.
mamba 1.5.9: overriding channel, version and build from installed packages due to --force-reinstall.

Looking for: ['conda==24.11.3', 'mamba==1.5.9']


Pinned packages:
  - python 3.12.*


Could not solve for environment specs
The following packages are incompatible
├─ conda 24.11.3 py312h7900ff3_0 is requested and can be installed;
└─ mamba 1.5.9 py312h9460a1c_0 is not installable because it requires
   └─ conda >=24,<24.11.0 , which conflicts with any installable versions previously reported.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/tljh/hub/lib/python3.12/site-packages/tljh/installer.py", line 560, in <module>
    main()
  File "/opt/tljh/hub/lib/python3.12/site-packages/tljh/installer.py", line 534, in main
    ensure_user_environment(args.user_requirements_txt_url)
  File "/opt/tljh/hub/lib/python3.12/site-packages/tljh/installer.py", line 259, in ensure_user_environment
    conda.ensure_conda_packages(
  File "/opt/tljh/hub/lib/python3.12/site-packages/tljh/conda.py", line 128, in ensure_conda_packages
    utils.run_subprocess(
  File "/opt/tljh/hub/lib/python3.12/site-packages/tljh/utils.py", line 42, in run_subprocess
    raise subprocess.CalledProcessError(cmd=cmd, returncode=proc.returncode)
subprocess.CalledProcessError: Command '['/opt/tljh/user/bin/mamba', 'install', '--yes', '--force-reinstall', '-c', 'conda-forge', '--prefix', '/opt/tljh/user', 'conda==24.11.3', 'mamba==1.5.9']' returned non-zero exit status 1.

The decisive part of this log is the dependency conflict, rather than the mod/etag warnings: the selected Mamba build requires conda >=24,<24.11.0, while the command explicitly asks for conda==24.11.3.

I checked TLJH’s current installer.py. On an upgrade, that reinstall step reads the already-installed Conda/Mamba versions and pins those exact versions for reinstallation. So the log does not necessarily mean the new TLJH release chose that pair as its recommended versions.

Before changing the shared user environment, I’d check what is actually installed there:

/opt/tljh/user/bin/conda list --prefix /opt/tljh/user '^(conda|mamba|python)$' --show-channel-urls

This lists the matching packages and their channels. What does it show, and which TLJH version are you upgrading from/to? Did Conda get upgraded separately before this?

I haven’t reproduced your environment, so I wouldn’t suggest a blind downgrade, deleting /opt/tljh/user, or changing Python yet. The next step is to establish the installed builds and a compatible Conda/Mamba pair, not keep retrying the same pinned reinstall.

Hi Rei,
packages in environment at /opt/tljh/user:
conda 24.11.3 py312h7900ff3_0 conda-forge
mamba 1.5.9 py312h9460a1c_0 conda-forge
python 3.12.6 hc5c86c4_1_cpython conda-forge

Name: the-littlest-jupyterhub
Version: 2.0.0

Tying upgrade to latest version in an attempt to address vulnerabilities found by Nessus scanner.

Managed to resolve the problem by updating mamba. the upgrade completed cleanly and, as a bonus, the reinstall step now picked up a latest compatible pair:

  • conda 26.9.3
  • mamba 2.9.0