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

filesystem error: cannot make absolute path with 0.26 #1975

Closed
erwanp opened this issue Oct 2, 2022 · 26 comments · Fixed by #1978
Closed

filesystem error: cannot make absolute path with 0.26 #1975

erwanp opened this issue Oct 2, 2022 · 26 comments · Fixed by #1978

Comments

@erwanp
Copy link

erwanp commented Oct 2, 2022

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
Copy link
Collaborator

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
Copy link
Author

erwanp commented Oct 2, 2022

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
Copy link
Collaborator

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
Copy link
Collaborator

also can you run with trace log level

@wolfv
Copy link
Member

wolfv commented Oct 2, 2022

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

@alonisser
Copy link

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
Copy link

Verified this doesn't happen with micromamba 0.25

@erwanp
Copy link
Author

erwanp commented Oct 3, 2022

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

@wolfv
Copy link
Member

wolfv commented Oct 3, 2022

@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
Copy link
Member

wolfv commented Oct 3, 2022

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.

erwanp added a commit to radis/radis that referenced this issue Oct 3, 2022
@wolfv
Copy link
Member

wolfv commented Oct 3, 2022

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
Copy link
Member

Klaim commented Oct 3, 2022

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

@jonashaag
Copy link
Collaborator

@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

wolfv added a commit that referenced this issue Oct 3, 2022
Fixed crash when installing from env file with pip section (fix #1975)
@alonisser
Copy link

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

@wolfv
Copy link
Member

wolfv commented Oct 3, 2022

@alonisser we'll try to release a fix today (after hopefully fixing #1979 as well)

@wholtz
Copy link
Member

wholtz commented Oct 3, 2022

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
Copy link

alonisser commented Oct 4, 2022 via email

@thomas-fred
Copy link

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
Copy link
Member

wolfv commented Oct 4, 2022

@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
Copy link
Member

wolfv commented Oct 4, 2022

@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
Copy link

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

@wholtz
Copy link
Member

wholtz commented Oct 4, 2022

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
Copy link
Member

wholtz commented Oct 4, 2022

@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
Copy link
Member

wholtz commented Oct 4, 2022

0.27.0 images are now on Dockerhub.

@alonisser
Copy link

Confirmed that 0.27.0 works as expected

@wolfv
Copy link
Member

wolfv commented Oct 6, 2022

awesome, thanks!

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

Successfully merging a pull request may close this issue.

7 participants