mamba-org / mamba

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

filesystem error: cannot make absolute path with 0.26 #1975

Closed erwanp closed 2 years ago

erwanp commented 2 years ago

Hello;

Our package doesn't build anymore using Mamba, although it has always been in the past. It might be related to the new 0.26 version.

Details https://app.travis-ci.com/github/radis/radis/jobs/584458524#L310

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/travis/.mambarc'
trace    libmamba Configuration not found at '/home/travis/.condarc'
trace    libmamba Configuration not found at '/home/travis/.conda/condarc.d'
trace    libmamba Configuration not found at '/home/travis/.conda/condarc'
trace    libmamba Configuration not found at '/home/travis/.conda/.condarc'
trace    libmamba Configuration not found at '/home/travis/micromamba/.mambarc'
trace    libmamba Configuration not found at '/home/travis/micromamba/condarc.d'
trace    libmamba Configuration not found at '/home/travis/micromamba/condarc'
trace    libmamba Configuration not found at '/home/travis/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 'file_specs'
critical libmamba filesystem error: cannot make absolute path: Invalid argument []

I do not understand what's wrong from the error message. What informations do you need to debug ?

jonashaag commented 2 years ago

Hm that's curious. Can you please add a

micromamba config list

to your CI?

Btw, if you're open to switching to GitHub Actions you might want to try https://github.com/mamba-org/provision-with-micromamba, it will remove that 2 minute Conda env setup time. Also FYI on Travis you have 2 cores so you might want to use pytest-xdist to speed up your CI.

erwanp commented 2 years ago

Thanks for the answer. That's the only result :

> micromamba config list
show_banner: false

Thanks for the tips, too, we'll definitly implement them !

jonashaag commented 2 years ago

Can try removing everything else from the CI scripts except for the env creation? Just to see if that’s a problem with your specific setup or with Micromamba on Travis in any setup.

jonashaag commented 2 years ago

also can you run with trace log level

wolfv commented 2 years ago

We did change the filesystem implementation so it's possible there is a new bug now :/ I'll take a look!

alonisser commented 2 years ago

Also just hit this bug. was going to post this., never used mamba before but hitting this now in gitlab with both the micromamba docker and installing micromamba within the run

This is my trace

I'm getting critical libmamba filesystem error: cannot make absolute path: Invalid argument []
(With either this docker, or straight micromamba installation) 
When trying to run in gitlab CI runner 
```bash
create -f conda.yaml -y

Adding -p and a specific sub path didn't help, nor changing MAMBA_ROOT_PREFIX to be in the project folder

the full stack trace

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 '/root/.mambarc'
trace    libmamba Configuration not found at '/root/.condarc'
trace    libmamba Configuration not found at '/root/.conda/condarc.d'
trace    libmamba Configuration not found at '/root/.conda/condarc'
trace    libmamba Configuration not found at '/root/.conda/.condarc'
trace    libmamba Configuration not found at '/builds/ourcompany/data-science/surveys-clustering/survey-answers-clustering/mamba/.mambarc'
trace    libmamba Configuration not found at '/builds/ourcompany/data-science/surveys-clustering/survey-answers-clustering/mamba/condarc.d'
trace    libmamba Configuration not found at '/builds/ourcompany/data-science/surveys-clustering/survey-answers-clustering/mamba/condarc'
trace    libmamba Configuration not found at '/builds/ourcompany/data-science/surveys-clustering/survey-answers-clustering/mamba/.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 'file_specs'
critical libmamba filesystem error: cannot make absolute path: Invalid argument []
info     libmamba ****************** Backtrace End ********************

And my conda.yaml

name: survey-answers-clustering-mlflow-env
channels:
  - conda-forge

dependencies:
      - python=3.8
      - hdbscan=0.8.28
      - joblib=1.1.0 #because of problematic hdbscan dependency
      - bertopic=0.9.4
      - python-flair
      - spacy>=2.0.0,<3.0.0
      - numpy=1.21.0
      - pandas=1.3.5
      - spacy-model-en_core_web_sm=2.2.0
      - inflection=0.5.1
      - protobuf>=3.12.0,3.20
      - poetry
      - pip
      - pip:
        - mlflow==1.28.0
        - cloudpickle==1.6.0

Note this isn't happening with mamba installed directly via conda in the run, (with the continuumio/anaconda3 base image) but does happen with micromamba

alonisser commented 2 years ago

Verified this doesn't happen with micromamba 0.25

erwanp commented 2 years ago

Thanks for checking. How can I download Micromamba 0.25? What is the wget link?

wolfv commented 2 years ago

@erwanp you can use https://micro.mamba.pm/api/micromamba/$PLATFORM-$ARCH/$VERSION

E.g. https://micro.mamba.pm/api/micromamba/linux-64/0.25.1

wolfv commented 2 years ago

OK, I could reproduce the bug quite easily with a minimal env file:

name: survey-answers-clustering-mlflow-env
channels:
  - conda-forge

dependencies:
  - python=3.8
  - pip
  - pip:
    - rich

I'll check our calls to fs::absolute in the pip part now ... I think that's where the issue originates.

wolfv commented 2 years ago

I think I've isolated the issue – it happens when calling fs::absolute(yaml_file.parent_path()).string() }); which will call fs::absolute with an empty string when the yaml_file is passed like -f env.yml.

However, -f ./env.yml works fine.

I think we should transform the yaml_file to an absolute path before.

Klaim commented 2 years ago

Confirmed, doing so works for me so I pushed a potential fix.

jonashaag commented 2 years ago

@alonisser @erwanp Can you try one of the binaries on the bottom of this page? https://github.com/mamba-org/mamba/actions/runs/3173625108

I'm also attaching them there, you should be able to use:

curl -L https://github.com/mamba-org/mamba/files/9697211/micromamba-linux64.gz | gunzip > /tmp/micromamba

micromamba-osx64.gz

micromamba-linux64.gz

alonisser commented 2 years ago

Thanks for the fas fix @wolfv! when would this be integrated to the docker? I'm not working with the binary directly

wolfv commented 2 years ago

@alonisser we'll try to release a fix today (after hopefully fixing https://github.com/mamba-org/mamba/issues/1979 as well)

wholtz commented 2 years ago

when would this be integrated to the docker? I'm not working with the binary directly

I'll try to get the docker images out shortly after the new micromamba version lands on conda-forge. Generally it has been less than 24 hours after they appear on conda-forge, but I'll watch closely today and move them along quickly.

alonisser commented 2 years ago

Interesting. No automation for this? Would you be interested in an automation for that? (not sure if I can pull this off but I would look if possible)

בתאריך יום ב׳, 3 באוק׳ 2022, 18:21, מאת Will Holtz ‏< @.***>:

when would this be integrated to the docker? I'm not working with the binary directly

I'll try to get the docker images out shortly after the new micromamba version lands on conda-forge. Generally it has been less than 24 hours after they appear on conda-forge, but I'll watch closely today and move them along quickly.

— Reply to this email directly, view it on GitHub https://github.com/mamba-org/mamba/issues/1975#issuecomment-1265632877, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK6K4GW46HQMUOQ75B2P6DWBL2YJANCNFSM6AAAAAAQ23WUD4 . You are receiving this because you were mentioned.Message ID: @.***>

thomas-fred commented 2 years ago

Will this fix also handle a relative requirements.txt?

For me, the following environment.yml snippet:

dependencies:
  - pip
  - pip:  # delegate to pip for some packages
    - -r requirements.txt
  - ...

Will fail with:

Installing pip packages: -r ./requirements.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: '/tmp/./requirements.txt'

But using an absolute path for the requirements.txt succeeds.

Thanks for micromamba -- it's great!

wolfv commented 2 years ago

@thomas-fred I am not sure those two things are related. I think for relative requirements.txt some additional "inspection" would be necessary... it would be nice if you could file a new issue or open a PR :)

wolfv commented 2 years ago

@alonisser I think there is quite a bit of automation in the micromamba-docker project, but I am sure that more help is always welcome!

alonisser commented 2 years ago

Thanks, just saw it runs every 6 hours after the release.. I'll wait

wholtz commented 2 years ago

Interesting. No automation for this? Would you be interested in an automation for that? (not sure if I can pull this off but I would look if possible)

@alonisser - I am interested in PRs to improve the automation. I have done a fair amount already. If you want to work on this, I suggest you start by reading mamba-org/micromamba-docker issue #120. There are some restrictions to how an automatic workflow performing an on:pull-request can trigger another workflow and these restrictions have shaped the current set of automation.

wholtz commented 2 years ago

@thomas-fred I am not sure those two things are related. I think for relative requirements.txt some additional "inspection" would be necessary... it would be nice if you could file a new issue or open a PR :)

I think issue #1726 already covers this.

wholtz commented 2 years ago

0.27.0 images are now on Dockerhub.

alonisser commented 2 years ago

Confirmed that 0.27.0 works as expected

wolfv commented 2 years ago

awesome, thanks!