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

Clarify error message #9830

Closed
wants to merge 1 commit into from
Closed

Conversation

SeanColombo
Copy link

@SeanColombo SeanColombo commented Jan 13, 2021

As a user, this error is pretty hard to figure out on its own. Attempted to clarify the error message so that the user can immediately resolve if they run into this.

To trigger this error, sudo su - to root, then run any command of a snap-installed program. Specific commands to reproduce (yes, I realize sudo doesn't do much as root ;) but I'm copy/pasting from tutorials):

  1. sudo su -

  2. sudo snap refresh core

  3. sudo snap install --classic certbot

  4. sudo ln -s /snap/bin/certbot /usr/bin/certbot

  5. sudo snap set certbot trust-plugin-with-root=ok

  6. sudo certbot --apache
    permanently dropping privs did not work

This has to be done the first time. After I've successfully installed/run certbot once as a non-root user, then it works from that point onwards even if I'm root.

I have signed the license agreement and read the contribution guide.

As a user, this error is pretty hard to figure out on its own. Attempted to clarify the error message so that the user can immediately resolve if they run into this.
@@ -501,9 +501,9 @@ int main(int argc, char **argv)
die("setuid failed");

if (real_gid != 0 && (getuid() == 0 || geteuid() == 0))
die("permanently dropping privs did not work");
die("permanently dropping privs did not work. you must use sudo but you must NOT be logged in as root.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe how you triggered this error?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bboozzoo added reproduction steps to the PR description

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SeanColombo, I tried your reproducer on a 20.04 system and couldn't reproduce, could you maybe open a forum topic with details of like snap version and other details about this system so we can look into why this happened for you?

we don't typically like to use github to debug things like this as it's less visible to the wider community who may have other answers for you, typically only the snapd devs will look at these pr's

@bboozzoo
Copy link
Collaborator

bboozzoo commented Feb 2, 2021

Please open a forum topic at https://forum.snapcraft.io/ with details of the problem, so that we can debug it there and follow up with a PR if needed.

@bboozzoo bboozzoo closed this Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants