Are you using NixOS or is this a multi-user nix install on another distro? How did you install nix?
I don’t know too much about how nix works on other distros, but you seem to be using nix as a user, perhaps the mechanism to elevate nix’ permissions to edit the nix store isn’t working.
@TLATER can you know any specific reason for this kind of behavior of Nix (Permission issue). Rather then re-installing nix is we have any other solution also for above issue?
Though depending on the host system some system wide events require a re-installation of nix for various reasons. Though I fail to see why there ever should be permission issues with the nix-db.
Permission problems that deep below /nix usually are a hint for some kind of corrupted internals or a user error.
It is sad that you haven’t shown the DBs file details, like ownership and/or permissions, nor the exact command that caused the error.
That makes debugging this issue postmortem more gueswork than actual deduction.
Or is this from the affected ssytems logs prior to reinstallation?
If this is indeed a system that is affected right now, please check the permissions and ownerships of the daemon socket (/nix/var/nix/daemon-socket/socket)
The only 2 things that keep me confused across all your outputs:
Your socket and the nix-db are “executable”, I do not have this on my Mac nor NixOS machine
The files groups are nixbld rather than root or wheel as on my NixOS and Mac.
Whether or not this is acceptable or because of the version differences (I use 2.17pre on all of my machines) or specific to the host OS you use or even the reason for your problems, I have no clue…
Therefore one last question out of desperation: Is your host system using some security thing like Apparmor or SELinux? Noth whether you have actively configured it, just if it is enabled/installed in general?
ii libselinux1:amd64 3.3-1build2 amd64 SELinux runtime shared libraries
ii libsemanage-common 3.3-1build2 all Common files for SELinux policy management libraries
ii libsemanage2:amd64 3.3-1build2 amd64 SELinux policy management library
ii libsepol2:amd64 3.3-1build1 amd64 SELinux library for manipulating binary security policies
The command dpkg -l | grep apparmor is used to list installed packages on a Debian-based system and filter the results to show only the packages containing the term “apparmor” in their names or descriptions. Here’s a breakdown of the command:
dpkg -l : The dpkg command is a package manager used in Debian-based systems to manage installed packages. The -l option lists all installed packages along with their details.
| : The pipe symbol ( | ) is used to redirect the output of the preceding command to the next command as input.
grep apparmor : The grep command is a text search tool that filters the input based on a specified pattern. In this case, it searches for the term “apparmor” in the input obtained from the dpkg -l command.
By running dpkg -l | grep apparmor , you will get a list of installed packages that include “apparmor” in their names or descriptions. This can help you determine if the AppArmor security framework is installed on your system and which specific packages related to AppArmor are present.
Name Version Architecture Description
+++-==========================================-=======================================-============-================================================================================
ii apparmor 3.0.4-2ubuntu2.2 amd64 user-space parser utility for AppArmor
This seems to be ubuntu, which has it enabled by default. No idea how you’re supposed to make nix work with apparmor enabled, though, at best I might be able to handle selinux permissions.