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

Error: Couldn't find username for current user #173

Closed
shhong opened this issue Jan 29, 2021 · 4 comments · Fixed by #175
Closed

Error: Couldn't find username for current user #173

shhong opened this issue Jan 29, 2021 · 4 comments · Fixed by #175
Assignees
Labels

Comments

@shhong
Copy link

shhong commented Jan 29, 2021

I downloaded the 0.11.1 release and run it in CentOS 8. I got “Error: Couldn't find username for current user” every time both for pueue and pueued. I checked that whoami works fine and $USER shows the correct username. Any idea?

@Nukesor
Copy link
Owner

Nukesor commented Jan 29, 2021

Weird. The code for getting the username looks like this:

    use users::{get_current_uid, get_user_by_uid};

    let user = get_user_by_uid(get_current_uid())
        .ok_or(anyhow!("Couldn't find username for current user"))?;

https://docs.rs/users/0.11.0/users/fn.get_user_by_uid.html
This uses the system's user database, which might not be available due to security measures?

An alternative could be to use the whoami crate.

@Nukesor
Copy link
Owner

Nukesor commented Jan 29, 2021

Could you try and check if pueue works, if you run it directly from this branch?

git clone git@github.com:Nukesor/pueue
cd pueue/pueue
git checkout switch_to_whoami
cargo run --bin pueue -- status

@Nukesor Nukesor added the t: Bug label Jan 29, 2021
@Nukesor Nukesor self-assigned this Jan 29, 2021
@shhong
Copy link
Author

shhong commented Feb 1, 2021

switch_to_whoami works fine. Thanks!

@Nukesor
Copy link
Owner

Nukesor commented Feb 10, 2021

New version is released :)
You should be good to go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants