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

Micromamba search fails when run a second time #3636

Closed
3 tasks done
simon-ess opened this issue Nov 27, 2024 · 4 comments · Fixed by #3649
Closed
3 tasks done

Micromamba search fails when run a second time #3636

simon-ess opened this issue Nov 27, 2024 · 4 comments · Fixed by #3649
Assignees
Labels
type::bug Something isn't working

Comments

@simon-ess
Copy link

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

Expected environment not found

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I do not have this problem with Conda, just with Mamba

Describe your issue

If I freshly install micromamba (via downloading and running the install script as described here: https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html#automatic-install, followed by activating micromamba in my shell via

$ export MAMBA_ROOT_PREFIX=~/micromamba
$ eval "$(./.local/bin/micromamba shell hook -s posix)"

and then run the following two commands:

$ micromamba search python  # works
$ micromamba search python  # does not work

I get the following error:

info     libmamba ****************** Backtrace Start ******************
debug    libmamba Loading configuration
trace    libmamba Compute configurable 'create_base'
trace    libmamba Compute configurable 'no_env'
trace    libmamba Compute configurable 'no_rc'
trace    libmamba Compute configurable 'rc_files'
trace    libmamba Compute configurable 'root_prefix'
trace    libmamba Get RC files configuration from locations up to HomeDir
trace    libmamba Configuration not found at '/home/simonrose/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/.mambarc'
trace    libmamba Configuration found at '/home/simonrose/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.mambarc'
trace    libmamba Configuration not found at '/var/lib/conda/condarc.d/'
trace    libmamba Configuration not found at '/var/lib/conda/condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.condarc'
trace    libmamba Configuration not found at '/etc/conda/.mambarc'
trace    libmamba Configuration not found at '/etc/conda/condarc.d/'
trace    libmamba Configuration not found at '/etc/conda/condarc'
trace    libmamba Configuration not found at '/etc/conda/.condarc'
trace    libmamba Update configurable 'no_env'
trace    libmamba Compute configurable 'envs_dirs'
trace    libmamba Compute configurable 'file_specs'
trace    libmamba Compute configurable 'spec_file_env_name'
trace    libmamba Compute configurable 'env_name'
trace    libmamba Compute configurable 'use_default_prefix_fallback'
trace    libmamba Compute configurable 'use_root_prefix_fallback'
trace    libmamba Compute configurable 'use_target_prefix_fallback'
trace    libmamba Compute configurable 'target_prefix'
trace    libmamba Get RC files configuration from locations up to TargetPrefix
trace    libmamba Configuration not found at '/home/simonrose/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/.mambarc'
trace    libmamba Configuration found at '/home/simonrose/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.mambarc'
trace    libmamba Configuration not found at '/var/lib/conda/condarc.d/'
trace    libmamba Configuration not found at '/var/lib/conda/condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.condarc'
trace    libmamba Configuration not found at '/etc/conda/.mambarc'
trace    libmamba Configuration not found at '/etc/conda/condarc.d/'
trace    libmamba Configuration not found at '/etc/conda/condarc'
trace    libmamba Configuration not found at '/etc/conda/.condarc'
trace    libmamba Update configurable 'no_env'
trace    libmamba Compute configurable 'relocate_prefix'
trace    libmamba Compute configurable 'target_prefix_checks'
error    libmamba Expected environment not found at prefix: /home/simonrose/micromamba
critical libmamba Aborting.
info     libmamba ****************** Backtrace End ********************

This happens whether or not I have run micromamba activate.

This is the same error log as seen in #2128 and #3354; note that as in the second of the issues, if I manually create a conda-meta directory in my MAMBA_ROOT_PREFIX directory then the search works again.

It seems to be the case that the first run of micromamba search ... creates this directory, but without the conda-meta directory. The second run then fails because that directory does not exist.

mamba info / micromamba info

libmamba version : 2.0.4
     micromamba version : 2.0.4
           curl version : libcurl/8.10.1 OpenSSL/3.4.0 zlib/1.3.1 zstd/1.5.6 libssh2/1.11.1 nghttp2/1.64.0
     libarchive version : libarchive 3.7.4 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.6
       envs directories : /home/simonrose/micromamba/envs
          package cache : /home/simonrose/micromamba/pkgs
                          /home/simonrose/.mamba/pkgs
            environment : base (active)
           env location : /home/simonrose/micromamba
      user config files : /home/simonrose/.mambarc
 populated config files : /home/simonrose/.condarc
       virtual packages : __unix=0=0
                          __linux=3.10.0=0
                          __glibc=2.17=0
                          __archspec=1=x86_64_v4
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/nodefaults/linux-64
                          https://conda.anaconda.org/nodefaults/noarch
       base environment : /home/simonrose/micromamba
               platform : linux-64

Logs

info     libmamba ****************** Backtrace Start ******************
debug    libmamba Loading configuration
trace    libmamba Compute configurable 'create_base'
trace    libmamba Compute configurable 'no_env'
trace    libmamba Compute configurable 'no_rc'
trace    libmamba Compute configurable 'rc_files'
trace    libmamba Compute configurable 'root_prefix'
trace    libmamba Get RC files configuration from locations up to HomeDir
trace    libmamba Configuration not found at '/home/simonrose/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/.mambarc'
trace    libmamba Configuration found at '/home/simonrose/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.mambarc'
trace    libmamba Configuration not found at '/var/lib/conda/condarc.d/'
trace    libmamba Configuration not found at '/var/lib/conda/condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.condarc'
trace    libmamba Configuration not found at '/etc/conda/.mambarc'
trace    libmamba Configuration not found at '/etc/conda/condarc.d/'
trace    libmamba Configuration not found at '/etc/conda/condarc'
trace    libmamba Configuration not found at '/etc/conda/.condarc'
trace    libmamba Update configurable 'no_env'
trace    libmamba Compute configurable 'envs_dirs'
trace    libmamba Compute configurable 'file_specs'
trace    libmamba Compute configurable 'spec_file_env_name'
trace    libmamba Compute configurable 'env_name'
trace    libmamba Compute configurable 'use_default_prefix_fallback'
trace    libmamba Compute configurable 'use_root_prefix_fallback'
trace    libmamba Compute configurable 'use_target_prefix_fallback'
trace    libmamba Compute configurable 'target_prefix'
trace    libmamba Get RC files configuration from locations up to TargetPrefix
trace    libmamba Configuration not found at '/home/simonrose/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.mamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/mambarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/mamba/.mambarc'
trace    libmamba Configuration found at '/home/simonrose/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/condarc'
trace    libmamba Configuration not found at '/home/simonrose/.config/conda/.condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.mambarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc.d'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/condarc'
trace    libmamba Configuration not found at '/home/simonrose/micromamba/.condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.mambarc'
trace    libmamba Configuration not found at '/var/lib/conda/condarc.d/'
trace    libmamba Configuration not found at '/var/lib/conda/condarc'
trace    libmamba Configuration not found at '/var/lib/conda/.condarc'
trace    libmamba Configuration not found at '/etc/conda/.mambarc'
trace    libmamba Configuration not found at '/etc/conda/condarc.d/'
trace    libmamba Configuration not found at '/etc/conda/condarc'
trace    libmamba Configuration not found at '/etc/conda/.condarc'
trace    libmamba Update configurable 'no_env'
trace    libmamba Compute configurable 'relocate_prefix'
trace    libmamba Compute configurable 'target_prefix_checks'
error    libmamba Expected environment not found at prefix: /home/simonrose/micromamba
critical libmamba Aborting.
info     libmamba ****************** Backtrace End ********************

environment.yml

No response

~/.condarc

channels:
  - conda-forge
  - nodefaults
channel_priority: strict
@simon-ess
Copy link
Author

I should perhaps clarify that this isn't the only command that fails, but it is perhaps the easiest one to test. It seems that in general the root directory is not created correctly which causes several commands to be quite unhappy.

@Hind-M Hind-M self-assigned this Dec 2, 2024
@JohanMabille JohanMabille added the type::bug Something isn't working label Dec 2, 2024
@Hind-M
Copy link
Member

Hind-M commented Dec 3, 2024

Thank you for reporting this.

If you don't specify a target prefix with -n/-p options, the root prefix would be used by default (MAMBA_ROOT_PREFIX).
In this case, conda-meta directory is only created when using install or update commands. For the other ones, they necessarily need to operate on a valid prefix (root or not), meaning that it should contain conda-meta directory before running them.

micromamba info for example is an exception to these rules, as it's allowed to be used on non valid environments.
I think that repoquery (with search subcommand, which is equivalent to the search command you're using) should do the same (because they could be used independently from the environment itself).
This is fixed in #3649.

As for having the command fail the second time and not the first, I think that's most likely because of mixing commands (install, remove or others) which would create and remove conda-meta directory.
If not, please report with the exact commands sequence after micromamba installation.

@simon-ess
Copy link
Author

The exact sequence of commands, after installing micromamba using the installer, is

micromamba search python
micromamba search python

There are no other commands run in the meantime. You can see that the first time you run micromamba search ... it creates the path at the MICROMAMBA_ROOT_PREFIX, including the pkgs subfolder, but not including the conda-meta subfolder.

@Hind-M
Copy link
Member

Hind-M commented Dec 4, 2024

Unfortunately, I could not reproduce the second call failure in dev mode. So far, it fails from the first call of micromamba search python.
But either way, #3649 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants