pixi icon indicating copy to clipboard operation
pixi copied to clipboard

reqwest::Error: Path not found

Open claudiushaag opened this issue 2 years ago • 14 comments

Checks

  • [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example


Issue description

Sadly, I somehow managed to mess up pixi on my Windows system. I'm currently not able to pinpoint where the problem may lie, so I'm opening an Issue and updating it as I go. Maybe someone has an idea in the meantime.

I upgraded to v0.33.0 this morning. I set up a first global environment, doing something like

pixi g i -e standard python=3.10 numpy scipy matplotlib pandas h5py

After that, I wanted to create a new pixi project in an old repo of mine which used mamba. I did a

pixi init --import path_to_envfile.yml

but when tried to install it via pixi i, I ran into errors.

These kind of errors now persist in many projects of mine, here is a overview of them:


PS D:\PATH> pixi self-update
thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\reqwest-0.12.5\src\async_impl\client.rs:1901:38:
Client::new(): reqwest::Error { kind: Builder, source: Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } }
note: run with 'RUST_BACKTRACE=1' environment variable to display a backtrace

PS D:\PATH> pixi run lint
Pixi task (lint in test): ruff check
thread 'main' panicked at crates\pixi_utils\src\reqwest.rs:100:10:
failed to create reqwest Client: reqwest::Error { kind: Builder, source: Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } }
note: run with 'RUST_BACKTRACE=1' environment variable to display a backtrace

PS D:\PATH> pixi self-update --version 0.32.2
thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\reqwest-0.12.5\src\async_impl\client.rs:1901:38:
Client::new(): reqwest::Error { kind: Builder, source: Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } }
note: run with 'RUST_BACKTRACE=1' environment variable to display a backtrace

PS D:\PATH> pixi run lint
Pixi task (lint in test): ruff check
thread 'main' panicked at crates\pixi_utils\src\reqwest.rs:99:10:
failed to create reqwest Client: reqwest::Error { kind: Builder, source: Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } }
note: run with 'RUST_BACKTRACE=1' environment variable to display a backtrace

As one can see, I was also not able to downgrade the pixi version. I instead tried to delete all pixi related folders, in my case C:\pixi (this one surprised me, looked like a git-clone...? But maybe my mistake...)and C:\Users\XXX\.pixi, and reinstall with a different version. I managed to do that by modifying the install.ps1 script locally, and installed v0.32.2, as well as v.0.31.0 (as I explicitly remember a upgrade then, reading about the speedup....), but these kind of errors persist even then and I'm not able to install or run tasks in an old pixi project. Interestingly, I'm not yet able to reproduce the errors in a new pixi project.

I don't know if this is relevant, but in that process I also tried deinstalling pixi using the powershell command on pixi.sh. The reaction of my system was:

$PIXI_BIN = "$Env:LocalAppData\pixi\bin\pixi"; Remove-Item -Path $PIXI_BIN Remove-Item : Der Pfad "C:\Users\XXX\AppData\Local\pixi\bin\pixi" kann nicht gefunden werden, da er nicht vorhanden ist. In Zeile:1 Zeichen:48 + ... _BIN = "$Env:LocalAppData\pixi\bin\pixi"; Remove-Item -Path $PIXI_BIN + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Users\XXX\pixi\bin\pixi:String) [Remove-Item], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

Would love to get some help on this, especially as "simply" downgrading does not solve the problem...

Windows Setup is:

Windows 11 Pro, 10.0.22631

Expected behavior

claudiushaag avatar Oct 16 '24 14:10 claudiushaag

Hey, are you using "local" channels anywhere? Like a path to a -c C:/foo/? Or file:///C/foo?

wolfv avatar Oct 16 '24 16:10 wolfv

Hey, thanks for the fast reply! No, nothing of that sorts. I generated a test pixi.toml, which works in a clean folder, installing the environment, but when using the same .toml file in an older folder, having deleted the .pixi folder of that directory and run pixi clean cache, the error with "crates\pixi_utils\src\reqwest.rs:99:10:" pops up.

I have no problem with pixi i after cloning the same git repo into a different folder. So my best guess now would be that there is something messed up internally... When renaming the repo-folder, the install and the tasks work, but after renaming it back to its original name, the install again breaks.

I tried to read the backtrace, but its not very descriptive to me:

PS D:\XXX\Code\splines> $env:RUST_BACKTRACE = "full"; pixi i -vvv; Remove-Item Env:RUST_BACKTRACE
>> 
DEBUG pixi_config: Loading config from C:\ProgramData\pixi\config.toml
DEBUG pixi_config: Failed to load system config: C:\ProgramData\pixi\config.toml (error: failed to read config from 'C:\ProgramData\pixi\config.toml')
DEBUG pixi_config: Loading config from C:\Users\XXX\.config\pixi\config.toml
DEBUG pixi_config: Failed to load global config: C:\Users\XXX\.config\pixi\config.toml (error: failed to read config from 'C:\Users\XXX\.config\pixi\config.toml')
DEBUG pixi_config: Loading config from C:\Users\XXX\AppData\Roaming\pixi\config.toml
DEBUG pixi_config: Failed to load global config: C:\Users\XXX\AppData\Roaming\pixi\config.toml (error: failed to read config from 'C:\Users\XXX\AppData\Roaming\pixi\config.toml')
DEBUG pixi_config: Loading config from C:\Users\XXX\.pixi\config.toml
DEBUG pixi_config: Failed to load global config: C:\Users\XXX\.pixi\config.toml (error: failed to read config from 'C:\Users\XXX\.pixi\config.toml')
DEBUG pixi_config: Loading config from D:\XXX\Code\splines\.pixi\config.toml
DEBUG pixi_config: Failed to load local config: D:\XXX\Code\splines\.pixi\config.toml (error: failed to read config from 'D:\XXX\Code\splines\.pixi\config.toml')
 INFO pixi::environment: verifying prefix location is unchanged, with prefix file: D:\XXX\Code\splines\.pixi\envs\default\conda-meta\pixi_env_prefix
 INFO pixi::lock_file::update: the lock-file is up-to-date
DEBUG pixi::environment: Wrote environment file to: "D:\\XXX\\Code\\splines\\.pixi\\envs\\default\\conda-meta\\pixi"
thread 'main' panicked at crates\pixi_utils\src\reqwest.rs:99:10:
failed to create reqwest Client: reqwest::Error { kind: Builder, source: Os { code: 3, kind: NotFound, message: "Das System kann den angegebenen Pfad nicht finden." } }
stack backtrace:
   0:     0x7ff65c3bcccd - <unknown>
   1:     0x7ff65b6a9b99 - <unknown>
   2:     0x7ff65c39ae51 - <unknown>
   3:     0x7ff65c3c1026 - <unknown>
   4:     0x7ff65c3c08f8 - <unknown>
   5:     0x7ff65c3c19b5 - <unknown>
   6:     0x7ff65c3c1277 - <unknown>
   7:     0x7ff65c3c11bf - <unknown>
   8:     0x7ff65c3c11a8 - <unknown>
   9:     0x7ff65c78eda4 - <unknown>
  10:     0x7ff65c78f2a0 - <unknown>
  11:     0x7ff65bdda01d - <unknown>
  12:     0x7ff65bb76e9c - <unknown>
  13:     0x7ff65c7f6369 - <unknown>
  14:     0x7ff65c7b9cc4 - <unknown>
  15:     0x7ff65b2adeb3 - <unknown>
  16:     0x7ff65b1744b2 - <unknown>
  17:     0x7ff65b1a0df2 - <unknown>
  18:     0x7ff65b5afd4a - <unknown>
  19:     0x7ff65b5ad221 - <unknown>
  20:     0x7ff65b05ef26 - <unknown>
  21:     0x7ff65b5b5e67 - <unknown>
  22:     0x7ff65c7329dc - <unknown>
  23:     0x7ffc8202257d - BaseThreadInitThunk
  24:     0x7ffc8318af08 - RtlUserThreadStart

claudiushaag avatar Oct 16 '24 16:10 claudiushaag

Could you add one more v to -vv: -vvv this gives us the debug logging, maybe it tells us more. Also the pixi info is sometimes helpful. And do you have a minimal project file that can reproduce the error?

ruben-arts avatar Oct 17 '24 06:10 ruben-arts

I see pixi i -vv in the comment above :)

I believe this is related to some certificate files. We need to figure out what files reqwest is trying to open.

wolfv avatar Oct 17 '24 06:10 wolfv

Do you have a config file in .pixi/config.toml (in that folder?).

I checked the code, but we are just regularly creating a reqwest client at that stage so I am not sure why this errors in this way, and also not sure what file is being accessed. From your log I am guessing you are on Windows?

wolfv avatar Oct 17 '24 06:10 wolfv

Could you add one more v to -vv: -vvv this gives us the debug logging, maybe it tells us more. Also the pixi info is sometimes helpful. And do you have a minimal project file that can reproduce the error?

Thanks for looking into this! I added the -vvv option to above comment.

Yes, I'm on Windows, and no, there is no .pixi/config.toml. There is only a pyproject.toml in the project folder. I'm looking for a minimal project file, but currently, creating new projects works, as does renaming the project-repo-folder, where the pyproject.toml lies. I basically have two project folders I used yesterday during the upgrade, which don't work. Other pixi-projects work fine as far as I can tell.

Sorry to bother with such a weird edge case...

claudiushaag avatar Oct 17 '24 07:10 claudiushaag

We consider all panics on the latest version a bug, so all information to reproduce is welcome!

ruben-arts avatar Oct 17 '24 07:10 ruben-arts

It's pretty puzzling. I don't know if you have the time, but if you download ProcMon from Microsoft, you could look at which file is causing the issue:

Use Process Monitor: Process Monitor (ProcMon) is a powerful Windows tool that can track file system activity. a. Download Process Monitor from the Microsoft Sysinternals website. b. Run Process Monitor as administrator. c. In the filter settings:

  • Add a filter for "Process Name" is "your_program.exe"
  • Add a filter for "Result" contains "NAME NOT FOUND"

d. Clear the display (Ctrl+X) and start capturing events. e. Run your Rust program. f. Look for "CreateFile" operations with "NAME NOT FOUND" results.

https://learn.microsoft.com/en-us/sysinternals/downloads/procmon

wolfv avatar Oct 17 '24 08:10 wolfv

So, I digged a little deeper, within my ability of course....

I ran ProcMon, triggered a single pixi i in one of the critical folders and saved the log. I can send the files if you want, I also captured the behaviour of a working pixi i. To me it seems like the last file which has been tried to access is Users/XXX/.cache/pixi, but indeed, there is no pixi folder in .cache. Other Files which have a NAME NOT FOUND event, earlier in the process:

  • Users/XXX/.pixi/.config.toml
  • ProjectFolder/pixi.lock
  • Users/XXX/.pixi/bin/profapi.dll
  • Users/XXX/.pixi/bin/POWRPROF.dll
  • Users/XXX/.pixi/bin/pdh.dll
  • Users/XXX/.pixi/bin/userenv.dll
  • Users/XXX/.pixi/bin/CRYPTBASE.DLL
  • Users/XXX/.pixi/bin/UMPDC.dll

None of the dlls are in the bin folder, only the pixi.exe.

claudiushaag avatar Oct 17 '24 09:10 claudiushaag

Thanks, this already explains a lot. I believe the not founds are fine. Could you check if you do have a .cache/rattler folder instead of .cache/pixi?

ruben-arts avatar Oct 17 '24 09:10 ruben-arts

No, I currently don't have a .cache/rattler folder...

But, pixi info states a different cache folder, which in turn seems to hold the packages etc after checking it:

pixi info
      Pixi version: 0.31.0
          Platform: win-64
  Virtual packages: __win=0=0
                  : __archspec=1=skylake
         Cache dir: C:\Users\XXX\AppData\Local\rattler/cache
      Auth storage: C:\Users\XXX\.rattler\credentials.json
  Config locations: No config files found

claudiushaag avatar Oct 17 '24 11:10 claudiushaag

So I deleted both the User/XXX/.pixi folder, the User/XXX/AppData/Local/rattler folder and manually deleted the PATH references to pixi. Installed v0.33.0, and noticed one big thing: This bug seems to only happen when using VSCode's builtin PowerShell Console.

It does not seem to be rooted in any extension. Will now roll back VSCode, this was never a problem...

claudiushaag avatar Oct 17 '24 13:10 claudiushaag

Ah that sounds really strange, would that conclude this as an extreem edge case?

ruben-arts avatar Oct 17 '24 14:10 ruben-arts

After downgrading VSCode to 1.93.1 , pixi worked in the internal terminal just fine. I now upgraded back to 1.94.2 as a test, and now I'm also bug free. I'm currently not able to reproduce the behaviour. So I guess yes, as of now, I would mark that as a extrem edge case. Am wondering if the order of installing this specific VSCode and pixi version changed something. But I also have not a lot to go on to open an issue with VSCode. Lets hope for the best ;)

Thanks for your fast and thorough help!

claudiushaag avatar Oct 17 '24 14:10 claudiushaag