conda / conda

A system-level, binary package and environment manager running on all major operating systems and platforms.
https://docs.conda.io/projects/conda/
Other
6.38k stars 1.66k forks source link

conda breaks after attempting `jupyter lite build` with xeus-python-demo site #14011

Open connorferster opened 3 months ago

connorferster commented 3 months ago

Checklist

What happened?

I think there are two issues, an upstream one (conda) and a downstream one (jupyterlite). I have filed the jupyterlite issue here: https://github.com/jupyterlite/xeus-python-demo/issues/39

After attempting to build the jupyterlite xeus-python-demo site, I receive the following error message:

    conda.auxlib.exceptions.ValidationError: 'emscripten' is not a valid Platform

However, after receiving this error, conda then breaks and any attempt I make at creating a new environment or updating conda, I receive the same error message. The only way I have of fixing this is to delete my conda installation and reinstall it (which is starting to become a pain after three or four times).

This issue may not likely be related to the upstream issue but I don't think that conda should break after a failed jupyterlite build attempt. This issue is about the conda-breaking part.

Conda Info

<details><summary><pre>conda info</pre></summary>

**Note**: While this current installation is using miniforge3, the exact same thing happened on a miniconda3 installation in previous iteration.

<pre>
     active environment : base
    active env location : /home/connorferster/miniforge3
            shell level : 1
       user config file : /home/connorferster/.condarc
 populated config files : /home/connorferster/miniforge3/.condarc
          conda version : 24.3.0
    conda-build version : not installed
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=icelake
                          __conda=24.3.0=0
                          __glibc=2.35=0
                          __linux=6.4.6=0
                          __unix=0=0
       base environment : /home/connorferster/miniforge3  (writable)
      conda av data dir : /home/connorferster/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/connorferster/miniforge3/pkgs
                          /home/connorferster/.conda/pkgs
       envs directories : /home/connorferster/miniforge3/envs
                          /home/connorferster/.conda/envs
               platform : linux-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.10.14 Linux/6.4.6-76060406-generic pop/22.04 glibc/2.35 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
                UID:GID : 1000:1000
             netrc file : /home/connorferster/.netrc
           offline mode : False
</pre></details>

Conda Config

==> /home/connorferster/miniforge3/.condarc <==
channels:
  - conda-forge

Conda list

_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
brotli-python             1.1.0           py312h30efb56_1    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
ca-certificates           2024.6.2             hbcca054_0    conda-forge
certifi                   2024.6.2           pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py312hf06ca03_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
cloudpickle               3.0.0              pyhd8ed1ab_0    conda-forge
doit                      0.36.0             pyhd8ed1ab_0    conda-forge
empack                    4.0.0              pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
idna                      3.7                pyhd8ed1ab_0    conda-forge
importlib-metadata        8.0.0              pyha770c72_0    conda-forge
jupyter_core              5.7.2           py312h7900ff3_0    conda-forge
jupyterlite-core          0.3.0              pyhd8ed1ab_0    conda-forge
jupyterlite-xeus          0.1.9              pyhd8ed1ab_0    conda-forge
ld_impl_linux-64          2.40                 hf3520f5_7    conda-forge
libexpat                  2.6.2                h59595ed_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 14.1.0               h77fa898_0    conda-forge
libgomp                   14.1.0               h77fa898_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libsqlite                 3.46.0               hde9e2c9_0    conda-forge
libstdcxx-ng              14.1.0               hc0a3c3a_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libzlib                   1.3.1                h4ab18f5_1    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
mdurl                     0.1.2              pyhd8ed1ab_0    conda-forge
ncurses                   6.5                  h59595ed_0    conda-forge
networkx                  3.3                pyhd8ed1ab_1    conda-forge
openssl                   3.3.1                h4ab18f5_1    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
platformdirs              4.2.2              pyhd8ed1ab_0    conda-forge
pycparser                 2.22               pyhd8ed1ab_0    conda-forge
pygments                  2.18.0             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.12.4          h194c7f8_0_cpython    conda-forge
python_abi                3.12                    4_cp312    conda-forge
pyyaml                    6.0.1           py312h98912ed_1    conda-forge
readline                  8.2                  h8228510_1    conda-forge
requests                  2.32.3             pyhd8ed1ab_0    conda-forge
rich                      13.7.1             pyhd8ed1ab_0    conda-forge
setuptools                70.1.1             pyhd8ed1ab_0    conda-forge
shellingham               1.5.4              pyhd8ed1ab_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_0    conda-forge
typer                     0.12.3             pyhd8ed1ab_0    conda-forge
typer-slim                0.12.3             pyhd8ed1ab_0    conda-forge
typer-slim-standard       0.12.3               hd8ed1ab_0    conda-forge
typing_extensions         4.12.2             pyha770c72_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
urllib3                   2.2.2              pyhd8ed1ab_1    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zipp                      3.19.2             pyhd8ed1ab_0    conda-forge
zstandard                 0.22.0          py312h5b18bf6_1    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge

Additional Context

Full traceback for attempting to create a new environment after receiving the initial error from the jupyterlite build step
(base)  connorferster@pop-os  ~/code/jupyterlite-xeus-python   main ±  conda create -n newenv python=3.12
Channels:
 - conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
    current version: 24.3.0
    latest version: 24.5.0

Please update conda by running

    $ conda update -n base -c conda-forge conda

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/cli/main.py", line 83, in main_subshell
        exit_code = do_call(args, parser)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/cli/conda_argparse.py", line 199, in do_call
        result = getattr(module, func_name)(args, parser)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/notices/core.py", line 131, in wrapper
        return func(*args, **kwargs)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/cli/main_create.py", line 125, in execute
        return install(args, parser, "create")
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/cli/install.py", line 450, in install
        handle_txn(unlink_link_transaction, prefix, args, newenv)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/cli/install.py", line 468, in handle_txn
        unlink_link_transaction.print_transaction_summary()
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/link.py", line 1221, in print_transaction_summary
        legacy_action_groups = self._make_legacy_action_groups()
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/link.py", line 1201, in _make_legacy_action_groups
        self._pfe.prepare()
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/common/io.py", line 85, in decorated
        return f(*args, **kwds)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 750, in prepare
        self.paired_actions.update(
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 751, in 
        (prec, self.make_actions_for_record(prec)) for prec in largest_first
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 595, in make_actions_for_record
        extracted_pcrec = next(
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 596, in 
        (
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 599, in 
        PackageCacheData(pkgs_dir).query(pref_or_spec)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 166, in query
        for pcrec in self._package_cache_records.values()
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 306, in _package_cache_records
        self.load()
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 127, in load
        package_cache_record = self._make_single_record(base_name)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 369, in _make_single_record
        package_cache_record = PackageCacheRecord.from_objects(
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 790, in from_objects
        return cls(**init_vars)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 743, in __call__
        instance = super().__call__(*args, **kwargs)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/models/records.py", line 418, in __init__
        super().__init__(*args, **kwargs)
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 759, in __init__
        setattr(self, key, kwargs[key])
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 428, in __set__
        self.box(instance, instance.__class__, val),
      File "/home/connorferster/miniforge3/lib/python3.10/site-packages/conda/auxlib/entity.py", line 570, in box
        raise ValidationError(val, msg=e1)
    conda.auxlib.exceptions.ValidationError: 'emscripten' is not a valid Platform

`$ /home/connorferster/miniforge3/bin/conda create -n newenv python=3.12`

  environment variables:
                 CIO_TEST=
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/home/connorferster/miniforge3/bin/conda
             CONDA_PREFIX=/home/connorferster/miniforge3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=/home/connorferster/miniforge3/bin/python
               CONDA_ROOT=/home/connorferster/miniforge3
              CONDA_SHLVL=1
           CURL_CA_BUNDLE=
            DEFAULTS_PATH=/usr/share/gconf/pop.default.path
               LD_PRELOAD=
           MANDATORY_PATH=/usr/share/gconf/pop.mandatory.path
                     PATH=/home/connorferster/miniforge3/bin:/home/connorferster/miniforge3/cond
                          abin:/home/connorferster/.nvm/versions/node/v22.2.0/bin:/home/connorfe
                          rster/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb
                          in:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/
                          connorferster/.repobee/bin:/opt/ParaView-5.11/bin:/usr/local/go/bin
       REQUESTS_CA_BUNDLE=
            SSL_CERT_FILE=
               WINDOWPATH=2

     active environment : base
    active env location : /home/connorferster/miniforge3
            shell level : 1
       user config file : /home/connorferster/.condarc
 populated config files : /home/connorferster/miniforge3/.condarc
          conda version : 24.3.0
    conda-build version : not installed
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=icelake
                          __conda=24.3.0=0
                          __glibc=2.35=0
                          __linux=6.4.6=0
                          __unix=0=0
       base environment : /home/connorferster/miniforge3  (writable)
      conda av data dir : /home/connorferster/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/connorferster/miniforge3/pkgs
                          /home/connorferster/.conda/pkgs
       envs directories : /home/connorferster/miniforge3/envs
                          /home/connorferster/.conda/envs
               platform : linux-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.10.14 Linux/6.4.6-76060406-generic pop/22.04 glibc/2.35 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
                UID:GID : 1000:1000
             netrc file : /home/connorferster/.netrc
           offline mode : False

An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install 

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install 

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers? [y/N]: y
Upload successful.

Thank you for helping to improve conda.
Opt-in to always sending reports (and not see this message again)
by running

    $ conda config --set report_errors true

travishathaway commented 3 months ago

@connorferster,

Thanks for reporting this. We currently have this pull request open, which I hope will address this issue:

Please see that pull request for further updates on this issue.