DeterminateSystems / nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 2 million installs.
GNU Lesser General Public License v2.1
2.09k stars 52 forks source link

Bug: Unable to parse existing receipt `/nix/receipt.json`, it may be from an incompatible version of `nix-installer` #768

Open sambacha opened 10 months ago

sambacha commented 10 months ago

Error

Error: 
   0: Unable to parse existing receipt `/nix/receipt.json`, it may be from an incompatible version of `nix-installer`. Try running `/nix/nix-installer uninstall`, then installing again.
   1: missing field `is_present` at line 71 column 11

Metadata

key value
version 0.15.1
os macos
arch aarch64
Screenshot 2023-12-04 at 8 44 44 PM
grahamc commented 10 months ago

Hr… can you upload your receipt.json?

On Mon, Dec 4, 2023, at 11:45 PM, sam bacha wrote:

Error

Error: 0: Unable to parse existing receipt/nix/receipt.json, it may be from an incompatible version ofnix-installer. Try running/nix/nix-installer uninstall, then installing again. 1: missing fieldis_presentat line 71 column 11 Metadata

key value version 0.15.1 os macos arch aarch64 Screenshot.2023-12-04.at.8.44.44.PM.png (view on web) https://github.com/DeterminateSystems/nix-installer/assets/32783916/aa0d1a62-c904-4435-9799-a6396cb2606f

— Reply to this email directly, view it on GitHub https://github.com/DeterminateSystems/nix-installer/issues/768, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASXLDPR54NOWWV7QRWXDDYH2RE5AVCNFSM6AAAAABAHBWQR2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDKMRXGU2TKNI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Hoverbear commented 10 months ago

Did you try uninstalling before re-installing as the error recommended?

robjtede commented 4 months ago

Also came across this while attempting to upgrade nix.

Attempting the uninstall step exits with the same error, but suggests running uninstall with the older version which was used for original installation.

Using the older version was difficult, presumably there are all sort of improvements and bug fixes since then. After a restart, things were pretty broken, requiring manually deleting the Nix store disk (macOS). Only then did the install work using the newer installer.

TBH, it's a pretty scary process to have to do just because some new required fields in a config file I never knew existed are causing panics. Thankfully, all the necessary guidance was provided by error cause messages, so nice job on those 👍🏻