jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.02k stars 338 forks source link

Upgrade from 0.2.0 fails (because a corrupt conda/mamba file?) #918

Closed consideRatio closed 1 year ago

consideRatio commented 1 year ago

In #916 I fixed the upgrade tests that wasn't upgrading from the 0.2.0 version as they should, but that uncovered a test failure when upgrading from 0.2.0 (aka. latest).

I suspect its related to this warning.

WARNING Extracted package cache '/opt/tljh/user/pkgs/libxml2-2.9.12-h72842e0_0' has invalid 'repodata_record.json' file and will be removed: [json.exception.type_error.302] type must be string, but is null

Even though the actual error comes later, and is:

RemoveError: 'requests' is a dependency of conda and cannot be removed from conda's operating environment.
minrk commented 1 year ago

I'll have a look when I get a chance (likely next week), but my hunch is the problem is a bug in too-old conda in the 0.2 env. Not sure what the solution will be.

minrk commented 1 year ago

The repodata warning is just a warning about missing metadata and should be safely ignored, I think.

The issue seems to stem from the 0.2 env having a 'requests' installed via 'pip' (upgraded during the `pip install --upgrade step), which mamba doesn't handle during the upgrade because it wants to upgrade requests, but removing the pypi version isn't allowed, even though it's set to be replaced by the conda version.

This might be a bug in mamba, but is a general issue of the sequence conda install -> pip install -> conda upgrade for the same package, which is always a recipe for trouble. I'll think about the best way to resolve it.