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

Nix error when updating lock file: adding a file to a tree builder: failed to insert entry: invalid object specified #1514

Open
tomaskallup opened this issue Oct 9, 2024 · 6 comments
Labels
bug Something isn't working nix An upstream issue with Nix

Comments

@tomaskallup
Copy link

So I needed a newer kernel for my new laptop, so I updated my system (still on Nixpkgs 24.05 tho) and now all my devenvs stopped working. They seem to work at first, but if I change anything in the setup, I endup with this:

• Updating devenv.lock ...
error:
       … while updating the lock file of flake 'git+file:///path/to/project'

       … while updating the flake input 'devenv'

       … while fetching the input 'github:cachix/devenv'

       error:
       error: adding a file to a tree builder: failed to insert entry: invalid object specified - command.rs

✖ Command produced the following output:


✔ Updating devenv.lock in 0.8s.
Error:   × Command `/nix/store/x74x4sz8ayv0dqc001za5rxxr26l0lmv-nix-2.21-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-
  │ experimental-features flakes --option warn-dirty false --keep-going --max-jobs 8 --option eval-cache false flake update` failed with with exit code 1

Looking at #1137, someone mentioned flake: false, but that did not help.

@sandydoo
Copy link
Member

sandydoo commented Oct 9, 2024

@tomaskallup
Copy link
Author

tomaskallup commented Oct 10, 2024

I tried nix.package = pkgs.nixVersions.nix_2_20; but devenv still fails, does it have it's own version of nix?

Edit:
Couldn't find a workaround, reverting to older devenv didn't help, as all of the older versions seem to use nix 2.21, guess I'm resurrecting my shell.nix, because otherwise I can't work.

@sandydoo
Copy link
Member

I tried nix.package = pkgs.nixVersions.nix_2_20; but devenv still fails, does it have it's own version of nix?

Yes, we use our own version with performance and bug fixes.

Couldn't find a workaround, reverting to older devenv didn't help, as all of the older versions seem to use nix 2.21, guess I'm resurrecting my shell.nix, because otherwise I can't work.

Hmm. Would've thought dropping down to v1.1 would help. Might need to clear ~/.cache/nix or something.

We could try rolling back the Nix commit mentioned in the above issues.

@sandydoo
Copy link
Member

@tomaskallup, which version of devenv were you on when the error appeared?

@sandydoo sandydoo added bug Something isn't working nix An upstream issue with Nix and removed question Further information is requested labels Oct 10, 2024
@sandydoo sandydoo changed the title Updated my system, devenv stopped working Nix error when updating lock file: adding a file to a tree builder: failed to insert entry: invalid object specified Oct 10, 2024
@tomaskallup
Copy link
Author

@tomaskallup, which version of devenv were you on when the error appeared?

I'm not really sure, I'd say <= 1.0.5, but I don't remember.

I'll try removing the cache, maybe that will help.

@tomaskallup
Copy link
Author

tomaskallup commented Oct 10, 2024

Allright, removing the cache did help! I can now seemingly use devenv, I have the following in my configuration.nix:

{ pkgs, ... }:
{
  nixpkgs.config.packageOverrides = pkgs: {
    frozenDevenv = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/613f8ec128bb662e8478a07aec7c8b5b236430bb.tar.gz") {
      inherit pkgs;
      config.allowUnfree = true;
    };
  };
  environment.systemPackages = [pkgs.frozenDevenv.devenv]
}

And it works (it uses devenv 1.1.0).

Edit:
For anyone wondering, the commit hash is parent of this commit NixOS/nixpkgs@aac6c07, which seems to be the breaking one in 24.05.

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

No branches or pull requests

2 participants