nix
nix copied to clipboard
flake update: json.exception.type_error.302
Describe the bug
I cannot use nix flake update command on my current configuration
Steps To Reproduce
➜ nix flake update
error: [json.exception.type_error.302] type must be string, but is null
Expected behavior
➜ nix flake update
| * Updated 'nixpkgs': 'github:NixOS/nixpkgs/3d2d8f281a27d466fa54b469b5993f7dde198375' -> 'github:NixOS/nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293'
nix-env --version output
nix-env (Nix) 2.10.3
Additional context
OS: NixOS 22.11.20220828.a63021a (Raccoon) x86_64
That seems to be due to an issue with the gitlab fetcher: gitlab:pleshevskiy/dedsec-grub-theme/nix-flake wants to fetch the nix-flake branch of pleshevskiy/dedsec-grub-theme, but it doesn't exist and the gitlab API returns an empty json array, which confuses Nix.
Thank you! It may have been deleted in the merge.
P.S. The error could have been a bit better. For example "trying to update dedsec-grub-theme flake, but there was an error".
P.S. The error could have been a bit better. For example "trying to update dedsec-grub-theme flake, but there was an error".
Of totally, there's definitely a Nix issue here :)
Pfff, I've hit this one and it's quite baffling.
It happened because I had outdated flake.lock from a different project, but it took me a while to figure out it's Nix complaining about the lock file, ideally there would be some context why JSON exception occurred.
@bburdette this one is a real pain.
Mentioned on twitter: https://twitter.com/kerckhove_ts/status/1605154924542705668?s=20&t=sp6J0cte0iYt4UvCY9Bbtw
Note that the problem is not the error per-se, but the lag of diagnostic info.
Still relevant
Mentioned on twitter: https://twitter.com/kerckhove_ts/status/1605154924542705668?s=20&t=sp6J0cte0iYt4UvCY9Bbtw
the link is dead, was there anything useful?
Just happened upon similar problem with a new machine, while there are no issues using the same repository on the old ones. nix-build ends up with error: [json.exception.type_error.302] type must be array, but is string and debugging it is a bit hard
Mentioned on twitter: twitter.com/kerckhove_ts/status/1605154924542705668?s=20&t=sp6J0cte0iYt4UvCY9Bbtw
the link is dead, was there anything useful?
Just happened upon similar problem with a new machine, while there are no issues using the same repository on the old ones.
nix-buildends up witherror: [json.exception.type_error.302] type must be array, but is stringand debugging it is a bit hard
What version did you notice this on? That sounds a lot like https://github.com/NixOS/nix/issues/13254, which https://github.com/NixOS/nix/pull/13256 fixed and will be in the next release (shameless plug, this is also fixed in the currently-released Determinate Nix 3.6.1).
@cole-h I just got back with an update, this is indeed on 2.29.0 and likely related, but in my case this was because dockerTools didn't generate a config, substitutor tried to find the config derivation because the file was missing, and likely this lead to the error itself.
I am yet to reproduce no config on another machine to file an issue, as I wasn't able to find one.
So the reason in my case was different, but a diagnostic message with context would've helped a lot. I've managed to debug it with increased verbosity -vvv but it required some searching around for what derivation is missing when it shouldn't.
@cole-h I've reproduced the issue with images we use in production, nix 2.29 fails, where nix 2.28 works fine. But I have trouble creating a reproducible docker image because of a different error, so I guess I will leave it at that for now.
my issue with dockerTools seems to have been fixed in 2.29.1, as this no longer reproduces