question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sudoers file doesn't work if the user is not a member of the `staff` group

See original GitHub issue

Rancher Desktop Version

0.7.1

Rancher Desktop K8s Version

0.22.5

What operating system are you using?

macOS

Operating System / Build Version

macOS Monterey 12.1

What CPU architecture are you using?

x64

Windows User Only

No response

Actual Behavior

Cannot start rancher desktop (Tried factory reset, fresh install)

Steps to Reproduce

Open Rancher Desktop

Result

Error occurs

Expected Behavior

It should start normally

Additional Information

time="2021-12-22T09:24:13-03:00" level=fatal msg="failed to run [sudo --user root --group wheel --non-interactive /bin/mkdir -m 775 -p /private/var/run/rancher-desktop-lima]: stdout=\"\", stderr=\"sudo: a password is required\\n\": exit status 1"
2021-12-22T12:24:13.011Z: + limactl start --tty=false 0
2021-12-22T12:24:13.011Z: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
2021-12-22T12:24:13.011Z: Error starting lima: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
    at ChildProcess.<anonymous> (/Applications/Rancher Desktop.app/Contents/Resources/app.asar/dist/app/background.js:1:8218)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:38 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
mlewecommented, Jan 3, 2022

The problem here seems to be that the sudoers file installed by Rancher Desktop assumes that the current user is a member of the group ‘staff’. This was not the case for my user. After adding my user to the staff group, i.e.

sudo dscl . append /groups/staff GroupMembership $(whoami)

Rancher Desktop seems to start up normally in 0.7.1

1reaction
janduboiscommented, Jan 3, 2022

Hmm so should i do the following then?

First you should verify that you are indeed a member of the everyone group:

$ id
uid=501(jan) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),[...]
  1. Factory reset and quit Rancher Desktop

Factory reset is not necessary, but won’t hurt. But you have to stop RD.

  1. Edit ~/Library/Application\ Support/rancher-desktop/lima/_config/networks.yaml and change from staff to everyone

Yes

  1. Remove /private/etc/sudoers.d/rancher-desktop-lima

Should not be necessary because it will be overwritten in the next step.

  1. Restart Ranched Desktop?

This should again ask you for your password, so it can regenerate the sudoers file with the new content, and then I hope it will all work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix "Username is not in the sudoers file. This incident ...
The /etc/sudoers file was altered to prevent users in sudo or admin group from elevating their privileges to that of root using sudo...
Read more >
"user is not in the sudoers file. this incident will be reported ...
The solution for this was simply to add my user to the sudo group using #adduser username sudo . So, if you ever...
Read more >
Username is not in the sudoers file. This incident will be reported
Open another terminal window. Step 9. Try any sudo command to check if your username is correctly added to sudoers file. I used...
Read more >
Linux: 'Username' is not in the sudoers file. This incident will ...
If you get an error saying user is not in the sudoers file, it means that the user doesn't have sudo privileges yet....
Read more >
'user is not in the sudoers file' but actually is
Have you tried creating a new user and adding that user to the sudo group, to see if that works? This may help...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found