CondaEnvException: Unable to determine environment

For some reason the CI pipeline started failing for my project Reproducible Data Science | Open Research | Renku with the error:

#7 [stage-1 3/4] RUN mamba env update -q -f /tmp/environment.yml &&     /op...
#7 7.070 
#7 7.070 CondaEnvException: Unable to determine environment
#7 7.070 
#7 7.070 Please re-run this command with one of the following options:
#7 7.070 
#7 7.070 * Provide an environment name via --name or -n
#7 7.070 * Re-run this command inside an activated conda environment.
#7 7.070 
#7 ERROR: executor failed running [/bin/bash -c -o pipefail mamba env update -q -f /tmp/environment.yml &&     /opt/conda/bin/pip install -r /tmp/requirements.txt --no-cache-dir &&     mamba clean -y --all &&     mamba env export -n "root" &&     rm -rf ${HOME}/.renku/venv]: exit code: 1

I tried starting from the newest renkulab python-minimal and cuda images. In all cases I get the same error.

I tried locally to run docker run --rm -it renku/renkulab-cuda:11.8-9d152cc bash, create the environment.yml file in the image, and then run mamba env update -q -f environment.yml. This works.

Hi @mrawlik, this sounds like a different symptom, but just to be sure, could you check if the defaults channel is included in your environment.yml and remove it?

It is. environment.yml is:

channels:
  - defaults
  - conda-forge
  - astra-toolbox
dependencies:
  - numpy
  - scipy
  - astra-toolbox
  - tomopy
  - xarray
  - astropy
  - pandas
  - h5py
  - matplotlib
  - scikit-image
  - black
  - papermill

Removing defaults doesn’t help. It pointed me in the right direction, though! I checked https://github.com/SwissDataScienceCenter/renku-project-template/blob/master/python-minimal/environment.yml and I see that there is now a crucial line

name: "base"

Adding this to my environment.yml fixed it.

It actually makes sense as environment.yml is used with conda env update (as opposed to conda env create), so I should be clear what environment am I basing myself on.