Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wsl issue with /etc/passwd spotted on hn #281

Closed
abathur opened this issue Feb 28, 2023 · 2 comments · Fixed by #297
Closed

Wsl issue with /etc/passwd spotted on hn #281

abathur opened this issue Feb 28, 2023 · 2 comments · Fixed by #297

Comments

@abathur
Copy link
Contributor

abathur commented Feb 28, 2023

sorry for the vague report, but just wanted to document something I saw someone on hn report. Don't have a windows system to corroborate/refute.

https://news.ycombinator.com/item?id=34963044

@cole-h cole-h changed the title Wsl issue with /etc/passed spotted on hn Wsl issue with /etc/passwd spotted on hn Feb 28, 2023
@cole-h
Copy link
Member

cole-h commented Feb 28, 2023

This looks to me like the user was using WSL1. If I try to install under WSL2, everything works as expected (+-; I also ran into #280).

However, if I try to install this under WSL1, I first get an error during installation when running /nix/store/..............-nix-2.13.2/bin/nix-env -i /nix/store/...........-nix-2.13.2. This then prompts me to revert (uninstall), and saying yes to that shows me the cannot lock /etc/passwd error message:

cannot lock /etc/passwd errors
Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Revert: Leave the Nix daemon unconfigured
 INFO Revert: Configure Nix
 INFO Revert: Provision Nix
Error:
   0: Error executing action
   1: Multiple errors: Failed to execute command (Command `"userdel" "nixbld2"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld3"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld0"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld18"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld1"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld4"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld19"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld14"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld30"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld5"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld7"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld8"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld27"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld24"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld31"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld20"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld26"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld11"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld12"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld6"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld29"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld10"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld17"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld25"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld23"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld9"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld28"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld15"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld16"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld22"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      ) & Failed to execute command (Command `"userdel" "nixbld13"` failed status 1, stderr:
      userdel: lock /etc/passwd.lock already used by PID 781
      userdel: cannot lock /etc/passwd; try again later.

      )

If the reporter from HN sees this: make sure your WSL distro is set to WSL2 by checking the version in wsl --list --verbose and upgrading the desired distro to WSL2 with wsl --set-version <distro name> 2.

@Hoverbear
Copy link
Contributor

Maybe we can add some detection in the planner to toss an error if it's in WSL1.

@cole-h cole-h mentioned this issue Mar 2, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants