mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.91k stars 357 forks source link

Package installation fails if it contains exclamation mark with micromamba 2 #3072

Closed racinmat closed 10 months ago

racinmat commented 10 months ago

Troubleshooting docs

Anaconda default channels

How did you install Mamba?

Micromamba

Search tried in issue tracker

yes

Latest version of Mamba

Tried in Conda?

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

Describe your issue

using micromamba, I want to create new environment where I install the newest x264, but it fails during extraction, because it can't handle the exclamation mark there. Here is the file in the conda-forge repository https://anaconda.org/conda-forge/x264/files note the versions which have !.

It's a linux machine:

cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

mamba info / micromamba info

libmamba version : 2.0.0
     micromamba version : 2.0.0
           curl version : libcurl/8.5.0 OpenSSL/3.2.0 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/matej.racinsky/micromamba/envs
          package cache : /home/matej.racinsky/micromamba/pkgs
                          /home/matej.racinsky/.mamba/pkgs
            environment : /home/matej.racinsky/miniconda3 (active)
           env location : /home/matej.racinsky/miniconda3
      user config files : /home/matej.racinsky/.mambarc
 populated config files : /home/matej.racinsky/.config/conda/.condarc
       virtual packages : __unix=0=0
                          __linux=3.10.0=0
                          __glibc=2.17=0
                          __archspec=1=x86_64-v4
                          __cuda=11.6=0
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/pytorch/linux-64
                          https://conda.anaconda.org/pytorch/noarch
                          https://conda.anaconda.org/nvidia/linux-64
                          https://conda.anaconda.org/nvidia/noarch
       base environment : /home/matej.racinsky/micromamba
               platform : linux-64

Logs

bin/micromamba create -f environments/x264.yml -r runtime -n x264 -y
error    libmamba Could not lock non-existing path '/home/matej.racinsky/.mamba/pkgs'

Transaction

  Prefix:.../runtime/envs/x264

  Updating specs:

   - x264

warning  libmamba Extracted package cache '.../runtime/pkgs/x264-1!164.3095-h166bdaf_2' has invalid url
  Package             Version  Build        Channel                              Size
───────────────────────────────────────────────────────────────────────────────────────
  Install:
───────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex         0.1  conda_forge  conda-forge     Cached
  + libgomp            13.2.0  h807b86a_3   conda-forge      422kB
  + _openmp_mutex         4.5  2_gnu        conda-forge       24kB
  + libgcc-ng          13.2.0  h807b86a_3   conda-forge     Cached
  + x264           1!164.3095  h166bdaf_2   conda-forge     Cached

  Summary:

  Install: 5 packages

  Total download: 445kB

───────────────────────────────────────────────────────────────────────────────────────

Transaction starting
_openmp_mutex                                       23.6kB @  ??.?MB/s  0.1s
libgomp                                            421.8kB @  ??.?MB/s  0.1s
Linking _libgcc_mutex-0.1-conda_forge
Linking libgomp-13.2.0-h807b86a_3
Linking _openmp_mutex-4.5-2_gnu
Linking libgcc-ng-13.2.0-h807b86a_3
Linking x264-1!164.3095-h166bdaf_2
warning  libmamba Extracted package cache '.../runtime/pkgs/x264-1!164.3095-h166bdaf_2' has invalid url
error    libmamba Cannot find a valid extracted directory cache for 'x264-1!164.3095-h166bdaf_2.tar.bz2'
critical libmamba Package cache error.

environment.yml

name: x264
dependencies:
  - x264

~/.condarc

channel_alias: https://artifactory.ida.avast.com/artifactory
channels:
  - conda-forge
  - pytorch
  - nvidia

allow_other_channels: False
t-bltg commented 10 months ago

Hi, I'm also hitting this error without a fix for now ...

It seems the error occurs in https://github.com/mamba-org/mamba/blob/main/libmamba/src/core/package_cache.cpp#L303-L304.

The error is always reproducible (also on linux).

Does anyone have a workaround ?

jonashaag commented 10 months ago

Version 2 is in alpha right now, you should not have gotten this downloaded. It's a bug on Mamba side.

pavelzw commented 10 months ago

should not have gotten this downloaded

see https://github.com/mamba-org/mamba/issues/2595#issuecomment-1864159795

t-bltg commented 10 months ago

Thanks @pavelzw, latest pointing to alpha is probably a mistake.

Using a stable release curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/1.5.5 | tar -xvj bin/micromamba is my workaround to this issue.

wolfv commented 10 months ago

Yes, this is a bug.

It's fixed if you use the new style install scripts: bash <(curl -L https://micro.mamba.pm/install.sh)

AntoinePrv commented 10 months ago

@racinmat you ended up finding a bug in 2.0, thanks !