prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.23k stars 178 forks source link

failed to get metadata from repodata.json file #932

Open maphew opened 8 months ago

maphew commented 8 months ago

Checks

Reproducible example

$ pixi --version
pixi 0.15.2

$ pixi global install ruff
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
  × failed to fetch repodata from channels
  ├─▶ failed to get metadata from repodata.json file
  ╰─▶ No such file or directory (os error 2)

Issue description

I don't seem to be able to complete any action the involves fetching from the network. Local actions like pixi init are okay.

Host

Kernel version: Windows 10 Enterprise, Multiprocessor Free Product type: Professional Product version: 6.3 Service pack: 0 Kernel build number: 19045

$ uname -a
Linux ENV-Y251322 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ pixi info
      Pixi version: 0.15.2
          Platform: linux-64
  Virtual packages: __unix=0=0
                  : __linux=5.15.133.1=0
                  : __glibc=2.35=0
                  : __cuda=12.2=0
                  : __archspec=1=x86_64
         Cache dir: /mnt/c/Users/xxxx/wsl/matt/.cache/rattler/cache
      Auth storage: /mnt/c/Users/xxxx/wsl/matt/.rattler/credentials.json

Project
------------
           Version: 0.1.0
     Manifest file: /mnt/d/code/YG/env-gis-coe/env-gis-dev/pixi.toml

Environments
------------
       Environment: default
          Features: default
          Channels: conda-forge
  Dependency count: 0
  Target platforms: linux-64

Expected behavior

error message(s) that indicate which folder and other resources are not available

maphew commented 8 months ago

pixi.toml:

[project]
name = "env-gis-dev"
version = "0.1.0"
description = "Add a short description here"
channels = ["conda-forge"]
platforms = ["linux-64"]

[tasks]

[dependencies]
maphew commented 8 months ago

On each network-using invocation 2 files are downloaded from conda-forge, then download status msg is replaced by the error (so can only capture with a carefully timed screenshot).

image

maphew commented 8 months ago

Results of pixi add esri -vvv 2>pixi-add-esri-vvv-error.txt attached. Post-processed to obfuscate username and remove consecutive duplicate lines.

maphew commented 8 months ago

The cache folder exists and has recently written files in it. The json file appears to well formed (Notepad++ Json Tools plugin 'pretty print json' works).

$ ls -la ~/.cache/rattler/cache/repodata
total 489368
drwxrwxrwx 1 matt matt      4096 Mar  7 11:59 .
drwxrwxrwx 1 matt matt      4096 Mar  6 08:44 ..
-rwxrwxrwx 1 matt matt  83877888 Mar  7 11:59 .tmpAlw4Am
-rwxrwxrwx 1 matt matt  84647936 Mar  7 11:59 .tmpfDa0U0
-rwxrwxrwx 1 matt matt 245083181 Mar  7 11:59 3018e552.json
-rwxrwxrwx 1 matt matt         0 Mar  6 08:44 3018e552.lock
-rwxrwxrwx 1 matt matt  86798678 Mar  7 11:59 36521c4e.json
-rwxrwxrwx 1 matt matt         0 Mar  6 08:44 36521c4e.lock
-rwxrwxrwx 1 matt matt    507618 Mar  6 08:45 5b854930.json
-rwxrwxrwx 1 matt matt         0 Mar  6 08:44 5b854930.lock
-rwxrwxrwx 1 matt matt    188444 Mar  6 08:45 a6b9ed4d.json
-rwxrwxrwx 1 matt matt         0 Mar  6 08:44 a6b9ed4d.lock
baszalmstra commented 7 months ago

Perhaps this has something to do with the fact that you are on WSL and the data is taken from you host system? What happens if you delete the contents of the repodata folder?

In WSL, are you running the host (Windows) pixi.exe or did you install pixi inside your linux environment? I would always recommend to use the latter.

maphew commented 7 months ago

Pixi installed in WSL. Removing repodata folder has no observable effect.

Santized console log:

matt@XXXXX:/mnt/d/code/yg/env-gis-coe/env-gis-dev$ which pixi
/mnt/c/Users/xxxx/wsl/matt/.pixi/bin/pixi
matt@XXXXX:/mnt/d/code/yg/env-gis-coe/env-gis-dev$ rm -rf ~/.cache/rattler
matt@XXXXX:/mnt/d/code/yg/env-gis-coe/env-gis-dev$ pixi add esri
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
  × failed to fetch repodata from channels
  ├─▶ failed to get metadata from repodata.json file
  ╰─▶ No such file or directory (os error 2)

by comparing with native Windows pixi I learned some of the above is misguided. Instead of pixi add esri I should have been using pixi project channel add esri; pixi add arcgis. However this doesn't work with WSL pixi either:

$ pixi project channel add esri
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
ERROR rattler_repodata_gateway::fetch: error=failed to get metadata from repodata.json file
  × failed to fetch repodata from channels
  ├─▶ failed to get metadata from repodata.json file
  ╰─▶ No such file or directory (os error 2)
maphew commented 2 months ago

still happens with current version. This isn't a blocker for me at the moment, I just noticed the issue was still open and thought I'd check status.

$ pixi --version
pixi 0.27.1
$ which pixi
/mnt/c/Users/me/wsl/matt/.pixi/bin/pixi
$ pixi global install ruff -vvv 2> wsl-pixi-install-ruff-err-log.txt

wsl-pixi-install-ruff-err-log.txt

wolfv commented 5 days ago

This is pretty strange. Basically, this fails at the

        file.metadata()
            .map_err(FetchRepoDataError::FailedToGetMetadata)

stage. Which should be equivalent to running stat <file> on the file. It also looks like ls is able to determine metadata on the files, so I am not sure what's happening here.