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

Cannot run devenv gc #1145

Open
p16i opened this issue Apr 18, 2024 · 7 comments
Open

Cannot run devenv gc #1145

p16i opened this issue Apr 18, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@p16i
Copy link

p16i commented Apr 18, 2024

Describe the bug
I have just moved to nixOS, and I am learning how to use devenv for my development environments. It seems that the devenv gc due to an error of unexpected argument for the command nix store gc.

To reproduce

In this case, the devenv.nix and devenv.yaml that I have are directly from what devenv init provides.

Error when running devenv gc

$ devenv -v  gc
✔ Removing non-existing symlinks in /home/pat/.local/share/devenv/gc ... in 0.0s.
• Found 10 active environments.
• Deleted 5 dangling environments (most likely due to previous GC).
• Running garbage collection (this process may take some time) ... ...• Running command: nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --keep-going --max-jobs 4 store gc /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/zkx25311cyffvbpl8jvb1aiikd58crnh-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env
error:
       error: unexpected argument '/nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env'

Version

devenv 1.0.4 
nix (Nix) 2.18.1
@p16i p16i added the bug Something isn't working label Apr 18, 2024
@sbocinec
Copy link

sbocinec commented Apr 18, 2024

I'm experiencing siimilar error with devenv gc and devenv 1.0.4 caused by the unknown impure argument:

cloudv on  main [$!?] via 🐹 v1.22.1 via  v18.12.1 with 🐃 v1.30.0 via ❄️  impure (devenv-shell-env) on ☁️ 
❯ devenv gc
✔ Removing non-existing symlinks in /home/stano/.local/share/devenv/gc ... in 0.0s.
• Found 9 active environments.
• Deleted 0 dangling environments (most likely due to previous GC).
error:
       error: unexpected argument '/nix/store/7fpp142mg3ccryxakwpz5q2pyf4yhf5h-devenv-shell-env'
Try '/nix/store/a0i9g29xgmk42gjjglzd6k0kzyjkay3n-nix-2.21-devenv/bin/nix --help' for more information.

✖ Command produced the following output:


✔ Running garbage collection (this process may take some time) ... in 0.0s.
Error:   × Command `/nix/store/a0i9g29xgmk42gjjglzd6k0kzyjkay3n-nix-2.21-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval-cache false --keep-
  │ going --max-jobs 6 store gc /nix/store/7fpp142mg3ccryxakwpz5q2pyf4yhf5h-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/
  │ r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/qjns4077lyh4626xa14ps875krjdb7fn-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-
  │ env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env --impure` failed with with exit code 1

This is my devenv.yaml:

allowUnfree: true
impure: true
inputs:
  nixpkgs:
    url: github:NixOS/nixpkgs/nixpkgs-unstable
  nixpkgs-terraform:
    url: github:stackbuilders/nixpkgs-terraform

@domenkozar domenkozar self-assigned this Apr 18, 2024
@domenkozar
Copy link
Member

@p16i does /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env exist?

@p16i
Copy link
Author

p16i commented Apr 18, 2024

@domenkozar thanks for promptly response!

This is what I got

$ ls -la  /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env
-r--r--r-- 1 root root 71596 Jan  1  1970 /nix/store/wymhs667k4ggiaz7lq1vcycsi97vkmwf-devenv-shell-env

It is there but empty.

@sbocinec
Copy link

sbocinec commented Apr 19, 2024

@domenkozar thanks for working on the issue 🙌

Btw is there a way how to run gc manually? I've tried to remove impure: true from my devenv.yaml, but it's still failing and I've already ran out of the disk space, completely blocked from using devenv rn.

$ devenv gc                                                       
✔ Removing non-existing symlinks in /home/stano/.local/share/devenv/gc ... in 0.0s.
• Found 14 active environments.
• Deleted 0 dangling environments (most likely due to previous GC).
error:
       error: unexpected argument '/nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env'
Try '/nix/store/a0i9g29xgmk42gjjglzd6k0kzyjkay3n-nix-2.21-devenv/bin/nix --help' for more information.

✖ Command produced the following output:


✔ Running garbage collection (this process may take some time) ... in 0.0s.
Error:   × Command `/nix/store/a0i9g29xgmk42gjjglzd6k0kzyjkay3n-nix-2.21-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features
  │ flakes --option warn-dirty false --option eval-cache false --keep-going --max-jobs 6 store gc /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/
  │ store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/7fpp142mg3ccryxakwpz5q2pyf4yhf5h-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-
  │ devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/
  │ r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/qjns4077lyh4626xa14ps875krjdb7fn-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-
  │ devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/
  │ r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-shell-env /nix/store/r3d57ii1jb27crfm7mxcww42v8jsw2mb-devenv-
  │ shell-env` failed with with exit code 1

@domenkozar
Copy link
Member

sudo -E nix-collect-garbage

@sbocinec
Copy link

sudo -E nix-collect-garbage

Awesome, TY!

One OT note for others: the command didn't work with -E ( I have devenv & nix installed on Ubuntu 22.04):

$ sudo -E nix-collect-garbage
sudo: nix-collect-garbage: command not found

Though switching to root without preserving the env vars (sudo -i) and executing nix-collect-garbage worked:

stano@rpu ~/workspace/redpanda/cloudv2/apps/external-dns-helper (main*?) $ sudo -i
root@rpu:~# which nix-collect-garbage 
/root/.nix-profile/bin/nix-collect-garbage
root@rpu:~# 
logout

$ which nix-collect-garbage
/nix/var/nix/profiles/default/bin/nix-collect-garbage

@domenkozar
Copy link
Member

This is a bug in this PR: NixOS/nix#8417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants