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

[BUG] V6.1.0 and V6.1.1 don't seem to work with V6.0.0 caches #82

Open
thenonameguy opened this issue Mar 11, 2025 · 7 comments · Fixed by #84
Open

[BUG] V6.1.0 and V6.1.1 don't seem to work with V6.0.0 caches #82

thenonameguy opened this issue Mar 11, 2025 · 7 comments · Fixed by #84
Assignees

Comments

@thenonameguy
Copy link

thenonameguy commented Mar 11, 2025

Describe the bug

Our GHA jobs started failing today, after the new minor and patch releases.
It seems internally the Nix JSON output gets broken with the old caches used:

 error: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - invalid literal; last read: 'D'
✖ Building shell in 4.94s
Error:   × Command `/nix/store/b3xyrhiwbdch46092bsvsnhy67119vsy-nix-2.24-devenv/
  │ bin/nix --show-trace --extra-experimental-features nix-command --extra-
  │ experimental-features flakes --option warn-dirty false --keep-going --max-
  │ jobs 2 --option eval-cache false --option extra-substituters https://
  │ devenv.cachix.org --option extra-trusted-public-keys devenv.cachix.org-
  │ 1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= print-dev-env --profile /
  │ home/runner/work/$REDACTED/.devenv/gc/shell -vv --log-format internal-
  │ json` failed with with exit code 1

Disabling the caching action or downgrading it with an explicit v6.0.0 version solved this problem.
It seems there might be a log message starting with D, breaking the JSON parsing of devenv.

To Reproduce

Sorry, I only have a private repo.

Expected behavior

Minor and patch version bumps don't break caches restored from former versions in any way.

Additional context

@deemp
Copy link
Collaborator

deemp commented Mar 11, 2025

@thenonameguy

I'm getting this error with caches created by the latest versions.

https://github.com/nix-community/nix-vscode-extensions/actions/runs/13786299760/job/38555690114#step:6:10

The job passes if it doesn't restore.

https://github.com/nix-community/nix-vscode-extensions/actions/runs/13786047382/job/38554685144

If you have a chance, please try debugging with action-tmate.

@deemp
Copy link
Collaborator

deemp commented Mar 11, 2025

@thenonameguy it'd be also nice if you could reproduce the problem with more verbosity.

@deemp
Copy link
Collaborator

deemp commented Mar 11, 2025

I can reliably reproduce the issue by running the failing job again.
https://github.com/nix-community/nix-vscode-extensions/actions/runs/13792030765/job/38588057479

Everything is OK if I run nix store gc before nix develop template/#.

@deemp
Copy link
Collaborator

deemp commented Mar 11, 2025

In my case, the problem is with codium --list-extensions. The devShell without that command runs OK.

UPD: not always

@deemp
Copy link
Collaborator

deemp commented Mar 12, 2025

Everything is OK if I run nix store gc before nix develop template/#.

When building template#devShells.x86_64-linux.default, I get a derivation as an output

/nix/store/plxips6qsndkhis09jfklzy77f2n0zb1-nix-shell.drv

After GC and building, I get a normal path.

/nix/store/w198z2pigg9p26g74c2p8bbdygkrrhfz-nix-shell

Something very wrong happens during saving/restoring a cache.

@deemp
Copy link
Collaborator

deemp commented Mar 12, 2025

@thenonameguy

v6.1.0 introduced changes to the SQL script that merges databases of two stores (existing and restored).

If there's a problem, it should be in that script https://github.com/nix-community/cache-nix-action/blob/aee88ae5efbbeb38ac5d9862ecbebdb404a19e69/src/templates/merge.sql

The script can be used with local stores created via nix build --store tmp/store1 nixpkgs#hello.

@deemp deemp mentioned this issue Mar 12, 2025
11 tasks
@deemp deemp linked a pull request Mar 12, 2025 that will close this issue
11 tasks
@deemp deemp closed this as completed in #84 Mar 12, 2025
@deemp deemp reopened this Mar 12, 2025
@deemp
Copy link
Collaborator

deemp commented Mar 12, 2025

@thenonameguy should be fixed in v6.1.2.

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.

2 participants