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

cachix: CppStdException "Exception: path '/nix/store/...' is not valid; type: nix::InvalidPath" #106

Closed
samuela opened this issue Jan 28, 2022 · 18 comments

Comments

@samuela
Copy link

samuela commented Jan 28, 2022

I'm seeing a weird error trying to use cachix-action.

/home/runner/work/_actions/cachix/cachix-action/v10/dist/main/push-paths.sh /home/runner/.nix-profile/bin/cachix ploop 
cachix: CppStdException "Exception: path '/nix/store/ab3yh7s8rms16b66jlbbzvjaif94ls93-python3.9-apache-beam-2.35.0' is not valid; type: nix::InvalidPath"
Error: Action failed with error: Error: The process '/home/runner/work/_actions/cachix/cachix-action/v10/dist/main/push-paths.sh' failed with exit code 1

Here's a link to the failed run: https://github.com/samuela/nixpkgs-upkeep/runs/4976168659?check_suite_focus=true.

Am I doing something wrong?

@samuela
Copy link
Author

samuela commented Feb 1, 2022

Just got the same thing on a different job:

cachix: CppStdException "Exception: path '/nix/store/qli5gyjqm0lizmxz2lqmybwgd3pvz1ji-tensorflow-gpu-2.7.0.drv.chroot' is not valid; type: nix::InvalidPath"
Error: Action failed with error: Error: The process '/home/runner/work/_actions/cachix/cachix-action/v10/dist/main/push-paths.sh' failed with exit code 1

Here's the run.

@samuela
Copy link
Author

samuela commented Feb 1, 2022

EDIT: in both of these cases I'm realizing that there were build errors in the job... My expectation was that nix would not leave partial file junk in /nix/store though?

@domenkozar
Copy link
Member

0.7.0 should fix this, I'll update the official url.

@steveej
Copy link

steveej commented Feb 17, 2022

i was wondering how to install cachix 0.7.0 using cachix/cachix-action@v10 today, and came up with the following solution:

- name: Setup cachix
  uses: cachix/cachix-action@v10
  with:
    (...)
    installCommand: |
      nix-env -if https://github.com/cachix/cachix/tarball/cachix-api-0.7.0 \
        --substituters 'https://cache.nixos.org https://cachix.cachix.org' \
        --trusted-public-keys 'cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY='

@steveej
Copy link

steveej commented Feb 17, 2022

installing cachix 0.7 as shown above doesn't solve my instance of the issue.
error copied from this run:

Cachix: push
  /Users/runner/work/_actions/cachix/cachix-action/v10/dist/main/push-paths.sh /Users/runner/.nix-profile/bin/cachix holochain-ci 
  cachix: CppStdException "Exception: \ESC[31;1merror:\ESC[0m path '\ESC[35;1m/nix/store/9lyllc4w3il5kkkmfnla455min34yz7b-rust-overlay-b4532ea\ESC[0m' is not valid; type: nix::InvalidPath"
  Error: Action failed with error: Error: The process '/Users/runner/work/_actions/cachix/cachix-action/v10/dist/main/push-paths.sh' failed with exit code 1

@domenkozar
Copy link
Member

I've released 0.7.0 and it should be the default, does that work now?

@austinbutler
Copy link

Tried again today with cachix-action@10, same issue.

@domenkozar
Copy link
Member

I'll look into this.

@flokli
Copy link

flokli commented Mar 4, 2022

I can also see this happening. I opened #111, which is related.

@runeksvendsen
Copy link

runeksvendsen commented Apr 7, 2022

We're seeing this, too:

Post job cleanup.
Cachix: push
  /home/runner/work/_actions/cachix/cachix-action/v10/dist/main/push-paths.sh /home/runner/.nix-profile/bin/cachix adamatic-bridge 
  cachix: CppStdException "Exception: \ESC[31;1merror:\ESC[0m path '\ESC[35;1m/nix/store/w7wj6qd654qwq9595r28bp1b6vp3fvky-nodejs-14.18.1.drv.chroot\ESC[0m' is not valid; type: nix::InvalidPath"
  Error: Action failed with error: Error: The process '/home/runner/work/_actions/cachix/cachix-action/v10/dist/main/push-paths.sh' failed with exit code 1

EDIT: Using cachix-action@10
EDIT2: This happens only when the build itself fails (after which cachix-action runs and also fails)

@purefn
Copy link

purefn commented Apr 20, 2022

Anyone know of a workaround for this issue? I'm running into it on a GitHub action that ends up building GHC. It eventually times out. Then it hits this error and so every build needs to rebuild GHC and ends up timing out and failing.

@domenkozar
Copy link
Member

That's terrible experience. I'll prioritize this and look into it tomorrow!

@domenkozar
Copy link
Member

To reproduce:

nix-build -E '(import <nixpkgs> {}).runCommand "foo" {} "sleep 999999999"'

Then in another terminal:

$ find /nix/store -maxdepth 1 -name *.drv.chroot
/nix/store/nz0ziflbx07n04szdhg0f60jk5givdla-foo.drv.chroot

And finally:

$ cachix push mycache /nix/store/nz0ziflbx07n04szdhg0f60jk5givdla-foo.drv.chroot
cachix: CppStdException e "\ESC[31;1merror:\ESC[0m path '\ESC[35;1m/nix/store/nz0ziflbx07n04szdhg0f60jk5givdla-foo.drv.chroot\ESC[0m' is not valid"(Just "nix::InvalidPath")
``

@domenkozar
Copy link
Member

This is now fixed in cachix/cachix#410

I'll make a release and let you know once it hits the channels!

Thanks for reporting!

@samuela
Copy link
Author

samuela commented Jun 27, 2022

Thanks so much @domenkozar!

@steveej
Copy link

steveej commented Jun 27, 2022

great news @domenkozar, thank you 🙌

@domenkozar
Copy link
Member

I've released 0.7.1, once it reaches nixpkgs I'll publish it as official (hopefully in a few days).

@domenkozar
Copy link
Member

Tracking at NixOS/nixpkgs#179211

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

No branches or pull requests

7 participants