canonical / jhack

Chock-full of Juju hackery.
Apache License 2.0
51 stars 24 forks source link

KeyError: 'getpwuid(): uid not found #67

Closed jamesbeedy closed 1 year ago

jamesbeedy commented 1 year ago

Hello,

Trying to run any jhack command gives:

$ jhack --help
Traceback (most recent call last):
  File "/snap/jhack/201/bin/jhack", line 8, in <module>
    sys.exit(main())
  File "/snap/jhack/201/lib/python3.8/site-packages/jhack/main.py", line 19, in main
    from jhack.config import configure
  File "/snap/jhack/201/lib/python3.8/site-packages/jhack/config.py", line 10, in <module>
    USR = pwd.getpwuid(os.getuid())[0]
KeyError: 'getpwuid(): uid not found: 115271064'
PietroPasotti commented 1 year ago

Umh, first time I see that. What environment are you in? multipass VM? Jhack.config needs to know what user you are in order to expand ~ and find where your jhack config is.

jamesbeedy commented 1 year ago

Hey @PietroPasotti, thanks for the swift response.

I have tested this on two systems, with latest stable and edge (revs 201 and 203).

Screenshot 2023-03-15 at 7 40 32 AM

on the left, my bdx user is a local user, on the right (where jhack is failing) the user is a non-local user (comes from active directory) Screenshot 2023-03-15 at 7 33 43 AM the system that jhack fails on is the system where the user is a non-local user

jamesbeedy commented 1 year ago

Screenshot 2023-03-15 at 7 43 08 AM

jamesbeedy commented 1 year ago

From mattermost discussion Screenshot 2023-03-15 at 7 50 47 AM