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
1.92k stars 50 forks source link

Can't install or repair due to corrupted Nix store #1006

Open the-sun-will-rise-tomorrow opened 2 months ago

the-sun-will-rise-tomorrow commented 2 months ago

I was testing the installer on a system that was shut down uncleanly during installation. Now, it is in a state where the installer is unable to either install or repair Nix.

/nix/nix-installer repair exits without producing any output.

Running the installer, I initially hit #1005; after working around that problem, the following error occurs.

Uninstalling then re-installing Nix allows it to proceed.

Perhaps the installer should always overwrite these files.

Error

Error: 
   0: Install failure
   1: Error executing action
   2: Action `configure_nix` errored
   3: Action `setup_default_profile` errored
   4: Failed to execute command with status 1 `HOME="/root" NIX_SSL_CERT_FILE="/nix/store/47h1qcdfp2gp7qlzpa41zgmg6drvmrkz-nss-cacert-3.95/etc/ssl/certs/ca-bundle.crt" "/nix/store/00dc6iygj63mjcmixki1vwg7m1jbdi9p-nix-2.21.2/bin/nix-env" "-i" "/nix/store/00dc6iygj63mjcmixki1vwg7m1jbdi9p-nix-2.21.2"`, stdout: 
      stderr: error: syntax error, unexpected end of file
             at /nix/store/3681kssclgak8rcvk9a0jhbpfcmm3sjq-env-manifest.nix:1:1:

Metadata

key value
version 0.19.1
os linux
arch x86_64
the-sun-will-rise-tomorrow commented 2 months ago

I think install --force should always recreate all files it would otherwise create on a blank system, and repair should do all of the same things as install except take the settings from the receipt. repair could then also have a --force flag that recreated all files with their correct pristine content.