Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.condarc Corruption Prevents Environment Initialization in Micromamba #3574

Closed
3 tasks done
ChaonengQuan opened this issue Oct 31, 2024 · 3 comments
Closed
3 tasks done

Comments

@ChaonengQuan
Copy link
Contributor

ChaonengQuan commented Oct 31, 2024

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

Anaconda default channels

  • I do NOT use the Anaconda default channels (pkgs/* etc.)

How did you install Mamba?

Micromamba

Search tried in issue tracker

Yes, but haven't found any similiar issue

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I have this problem with Conda as well, without using Mamba

Describe your issue

Description

When a .condarc file in the home directory is corrupted, micromamba fails to initialize the Conda shell properly, preventing environments dependent on micromamba from loading. This issue impacts any application that relies on micromamba to activate environments and can leave users unable to access their workspace or tools when re-opening sessions.

Impact

This issue affects open-source users by causing critical environments to fail when they rely on micromamba for activation. Any user with a corrupted .condarc file will be unable to start sessions dependent on the tool, resulting in failed load processes and inaccessible environments.

Reproduction Steps

  1. Create a new environment using micromamba.
  2. Add a corrupted .condarc file in the home directory.
# Example
echo "random text string" > ~/.condarc
  1. Attempt to initialize or re-open the environment.
  2. Observe errors due to the initialization failure caused by the corrupted .condarc file.

Proposed Solution

A suggested improvement would be to implement a safeguard or fallback mechanism within micromamba to bypass .condarc if it is unreadable or contains invalid configurations. For comparison, the .bashrc file in bash allows shell loading even if it contains invalid entries, enabling a more resilient startup process.

Thank you for considering this improvement to enhance micromamba's resilience against configuration file corruption.

mamba info / micromamba info

libmamba version : 1.5.8
     micromamba version : 1.5.8
           curl version : libcurl/8.6.0 OpenSSL/3.2.1 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
     libarchive version : libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5
       envs directories : /home/sagemaker-user/.conda/envs
                          /opt/conda/envs
          package cache : /home/sagemaker-user/.conda/pkgs
                          /opt/conda/pkgs
            environment : base (active)
           env location : /opt/conda
      user config files : /home/sagemaker-user/.mambarc
 populated config files : /opt/conda/.condarc
                          /opt/conda/.condarc
                          /etc/conda/.condarc
       virtual packages : __unix=0=0
                          __linux=5.10.226=0
                          __glibc=2.35=0
                          __archspec=1=x86_64-v4
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
       base environment : /opt/conda
               platform : linux-64

Logs

eval "$(micromamba shell hook --shell=bash)"

micromamba activate base

Any `micromamba` command

environment.yml

No response

~/.condarc

No response

@ChaonengQuan ChaonengQuan changed the title .condarc Corruption Prevents Environment Initialization in Micromamba .condarc Corruption Prevents Environment Initialization in Micromamba Oct 31, 2024
@ChaonengQuan
Copy link
Contributor Author

Fix for this bug, reviewed once with Julien (one of maintainers)
#3580

@JohanMabille
Copy link
Member

Fixed in #3580 .

@jjerphan
Copy link
Member

jjerphan commented Nov 22, 2024

@ChaonengQuan: this issue has been resolved in 1.5.11 (which is being released, see conda-forge/micromamba-feedstock#226 and conda-forge/mamba-feedstock#272) and in 2.0.4alpha3.

You can install 2.0.4alpha3 with:

micromamba install conda-forge/label/micromamba_prerelease::micromamba==2.0.4alpha3                                                                                                                                   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants