1

I'm attempting to finish the setup for plutus pioneers cohort3 on wsl2 (Windows 10) with Ubunutu 20.04. When I run the command:

nix --extra-experimental-features nix-command build -f default.nix plutus.haskell.packages.plutus-core.components.library

I get:

error: executing SQLite statement 'pragma synchronous = normal': unable to open database file (in '/nix/var/nix/db/db.sqlite')

I have already created /etc/nix/nix.conf to configure nix with the IOHK binary cache. I also checked and there is no var folder within the nix directory. Did I fail to create a db along the way or is something else amiss?

1
  • Welcome to Cardano SE! As a new user be sure to take the Tour.
    – gRebel
    Commented Jan 16, 2022 at 23:38

4 Answers 4

0

I had this problem yesterday and I found that shutting down the distro and restarting it after installing nix worked to fix this issue, it may work for you as well.

  • Exit out of the ubuntu distro
  • In a windows terminal (powershell or whatever) use wsl -l -v to see the running distros
  • Then use wsl --terminate <DistributionName> to stop the distro
  • Then use wsl --distribution <DistributionName> to start the distro again
  • Now you can try to build again.

Here's where I found the wsl commands - https://winaero.com/terminate-running-wsl-linux-distro-windows-10/

enter image description here

On another note you should be using the plutus-apps repo not the plutus repo. Here's a link to a doc from another pioneer who setup the environemnt with WSL that may help you - https://docs.google.com/document/d/1mLyuGmCvZLqFotpVElbhYR5Q6PUatGxSeGuulJ1izJA/edit

1
  • Welcome to Cardano SE! As a new user be sure to take the Tour.
    – gRebel
    Commented Jan 14, 2022 at 4:46
0

deleting the /nix/var directory

and then running

nix build -f default.nix docs.site --extra-experimental-features nix-command

fixed the

error: executing SQLite statement 'pragma synchronous = normal': unable to open database file (in '/nix/var/nix/db/db.sqlite')

error for me.

1
  • Welcome to Cardano SE! As a new user be sure to take the Tour.
    – gRebel
    Commented Jan 16, 2022 at 4:20
0

I had success by uninstalling/removing Nix, and then installing it again

Uninstalling:

  1. remove the . "$HOME/.nix-profile/etc/profile.d/nix.sh" line in your ~/.profile or ~/.bash_profile
  2. rm -rf $HOME/{.nix-channels,.nix-defexpr,.nix-profile,.config/nixpkgs}
  3. sudo rm -rf /nix

Reinstalling:

  1. sh <(curl -L https://nixos.org/nix/install) --no-daemon
  2. . $HOME/.nix-profile/etc/profile.d/nix.sh
0

You need to change the permissions on your /nix directory.

If you run this command you should be able to move forward:

chmod 775 /nix
2
  • Welcome to Cardano SE! As a new user be sure to take the Tour.
    – gRebel
    Commented Jan 14, 2022 at 4:41
  • add code in-line with enter code here
    – Hud
    Commented Jan 18, 2022 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.