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

doesn't work, some python error #38

Open
colemickens opened this issue Apr 17, 2023 · 8 comments
Open

doesn't work, some python error #38

colemickens opened this issue Apr 17, 2023 · 8 comments

Comments

@colemickens
Copy link

│Apr 17 11:20:52 zeph systemd[2987]: Stopping Pass libsecret service...                                                                                                                                                          │
│Apr 17 11:20:52 zeph systemd[2987]: Stopped Pass libsecret service.                                                                                                                                                             │
│Apr 17 11:20:52 zeph systemd[2987]: Started Pass libsecret service.                                                                                                                                                             │
│Apr 17 11:20:56 zeph pass_secret_service[1128397]: gpg: public key decryption failed: No secret key                                                                                                                             │
│Apr 17 11:20:56 zeph pass_secret_service[1128397]: gpg: decryption failed: No secret key                                                                                                                                        │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]: Exception in callback MessageBus._make_method_handler.<loc                                                                                                                   │
│als>.handler.<locals>.done(<Task finishe...te 'encode'")>) at /nix/store/x6456ccrfn102x8c6487p0lrm607g57j-pyt                                                                                                                   │
│hon3.10-dbus-next-0.2.3/lib/python3.10/site-packages/dbus_next/aio/message_bus.py:349                                                                                                                                           │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]: handle: <Handle MessageBus._make_method_handler.<locals>.h                                                                                                                   │
│andler.<locals>.done(<Task finishe...te 'encode'")>) at /nix/store/x6456ccrfn102x8c6487p0lrm607g57j-python3.1                                                                                                                   │
│0-dbus-next-0.2.3/lib/python3.10/site-packages/dbus_next/aio/message_bus.py:349>                                                                                                                                                │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]: Traceback (most recent call last):                                                                                                                                           │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:   File "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python                                                                                                                   │
│3-3.10.10/lib/python3.10/asyncio/events.py", line 80, in _run                                                                                                                                                                   │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:     self._context.run(self._callback, *self._args)                                                                                                                           │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:   File "/nix/store/x6456ccrfn102x8c6487p0lrm607g57j-python                                                                                                                   │
│3.10-dbus-next-0.2.3/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 351, in done                                                                                                                              │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:     result = fut.result()                                                                                                                                                    │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-s                                                                                                                   │
│ecret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/interfaces/service.py", li                                                                                                                   │
│ne 229, in GetSecrets                                                                                                                                                                                                           │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:     secrets[item_path] = await session._encode_secret(pass                                                                                                                   │
│word)                                                                                                                                                                                                                           │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-s                                                                                                                   │
│ecret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/common/tools.py", line 7,                                                                                                                    │
│in wraps                                                                                                                                                                                                                        │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:     return await loop.run_in_executor(None, lambda: f(*args, **kwargs))                                                                                                      │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:   File "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run                                            │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:     result = self.fn(*self.args, **self.kwargs)                                                                                                                              │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-secret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/common/tools.py", line 7, in <la│
│mbda>                                                                                                                                                                                                                           │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:     return await loop.run_in_executor(None, lambda: f(*args, **kwargs))                                                                                                      │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-secret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/interfaces/session.py", line 41,│
│ in _encode_secret                                                                                                                                                                                                              │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]:     password = password.encode("utf8")                                                                                                                                       │
│Apr 17 11:20:56 zeph pass_secret_service[1128186]: AttributeError: 'NoneType' object has no attribute 'encode'``

I can't deal with python anymore so I haven't dug in. NoneType, hurray.

gopass, prs, etc work fine.

@mdellweg
Copy link
Owner

I can only guess the error is here. (And not properly propagated...)
│Apr 17 11:20:56 zeph pass_secret_service[1128397]: gpg: public key decryption failed: No secret key

@colemickens
Copy link
Author

Except that I can use gpg manually, and my other password-store tools just fine:

~/.local/share/password-store master
❯ gpg -d airalo.com.gpg
gpg: encrypted with rsa4096 key, ID 0x62556A61E301DC21, created 2018-05-22
      "Cole Mickens <[email protected]>"
[redacted]

Yet if I restart pass-secret-service and just use it again, it fails with the same error:

Better paste this time:

Apr 17 15:16:42 zeph pass_secret_service[1330142]: gpg: public key decryption failed: No secret key
Apr 17 15:16:42 zeph pass_secret_service[1330142]: gpg: decryption failed: No secret key
Apr 17 15:16:42 zeph pass_secret_service[1329059]: Exception in callback MessageBus._make_method_handler.<locals>.handler.<locals>.done(<Task finishe...te 'encode'")>) at /nix/store/x6456ccrfn102x8c6487p0lrm607g57j-python3.10-dbus-next-0.2.3/lib/python3.10/site-packages/dbus_next/aio/message_bus.py:349
Apr 17 15:16:42 zeph pass_secret_service[1329059]: handle: <Handle MessageBus._make_method_handler.<locals>.handler.<locals>.done(<Task finishe...te 'encode'")>) at /nix/store/x6456ccrfn102x8c6487p0lrm607g57j-python3.10-dbus-next-0.2.3/lib/python3.10/site-packages/dbus_next/aio/message_bus.py:349>
Apr 17 15:16:42 zeph pass_secret_service[1329059]: Traceback (most recent call last):
Apr 17 15:16:42 zeph pass_secret_service[1329059]:   File "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/asyncio/events.py", line 80, in _run
Apr 17 15:16:42 zeph pass_secret_service[1329059]:     self._context.run(self._callback, *self._args)
Apr 17 15:16:42 zeph pass_secret_service[1329059]:   File "/nix/store/x6456ccrfn102x8c6487p0lrm607g57j-python3.10-dbus-next-0.2.3/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 351, in done
Apr 17 15:16:42 zeph pass_secret_service[1329059]:     result = fut.result()
Apr 17 15:16:42 zeph pass_secret_service[1329059]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-secret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/interfaces/service.py", line 229, in GetSecrets
Apr 17 15:16:42 zeph pass_secret_service[1329059]:     secrets[item_path] = await session._encode_secret(password)
Apr 17 15:16:42 zeph pass_secret_service[1329059]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-secret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/common/tools.py", line 7, in wraps
Apr 17 15:16:42 zeph pass_secret_service[1329059]:     return await loop.run_in_executor(None, lambda: f(*args, **kwargs))
Apr 17 15:16:42 zeph pass_secret_service[1329059]:   File "/nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
Apr 17 15:16:42 zeph pass_secret_service[1329059]:     result = self.fn(*self.args, **self.kwargs)
Apr 17 15:16:42 zeph pass_secret_service[1329059]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-secret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/common/tools.py", line 7, in <lambda>
Apr 17 15:16:42 zeph pass_secret_service[1329059]:     return await loop.run_in_executor(None, lambda: f(*args, **kwargs))
Apr 17 15:16:42 zeph pass_secret_service[1329059]:   File "/nix/store/5vq4mmvnxgz6zg04qrblr1xhgcs85bq1-pass-secret-service-unstable-2022-07-18/lib/python3.10/site-packages/pass_secret_service/interfaces/session.py", line 41, in _encode_secret
Apr 17 15:16:42 zeph pass_secret_service[1329059]:     password = password.encode("utf8")
Apr 17 15:16:42 zeph pass_secret_service[1329059]: AttributeError: 'NoneType' object has no attribute 'encode'


@colemickens
Copy link
Author

FWIW, I'm using --path /home/cole/.local/share/password-store

@mdellweg
Copy link
Owner

But still it seems to have issues finding your keys. Is it running as the right user?
If you are using the systemd files, i believe you need to put them in the users session somehow...

@colemickens
Copy link
Author

I did track this down, I needed to correctly list my LONG format gpg-id in the .gpg-id file in the password-store. I think that's mostly got things working.

@colemickens
Copy link
Author

Yeah, it's just back to doing this again, even though I haven't changed anything in my password-store setup. I have no idea what's different. Joy.

@colemickens
Copy link
Author

It's probably something to do with GNUPGHOME not getting hoisted into the systemd-user environment. Restoring the .gnupg symlink to where my gnpug home actually is fixes it again. Well, other than #40 .

@lucc
Copy link

lucc commented Jan 7, 2024

I think you can insert the GNUPGHOME variable into your systemd session with systemctl --user set-evironment GNUPGHOME="$GNUPGHOME".

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

No branches or pull requests

3 participants