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

Password prompt on every sync #217

Closed
nshi opened this issue Nov 29, 2022 · 15 comments
Closed

Password prompt on every sync #217

nshi opened this issue Nov 29, 2022 · 15 comments

Comments

@nshi
Copy link

nshi commented Nov 29, 2022

After the recent updates, I started getting the password prompt on every sync even with plstore-cache-passphrase-for-symmetric-encryption set to t. Any advice on what to check or try? Thanks.

@telotortium
Copy link
Collaborator

What code are you using exactly to set this variable? You should use something like

(setq-default plstore-cache-passphrase-for-symmetric-encryption t)

@telotortium
Copy link
Collaborator

Also what version of Emacs are you using? The relevant code is ancient, so it shouldn't matter, but just want to check.

@nshi
Copy link
Author

nshi commented Nov 29, 2022

(setq-default plstore-cache-passphrase-for-symmetric-encryption t)

This is exactly how I set the variable.

I'm using Emacs 27.1 on Ubuntu. org-gcal version is 20221120.2150.

@telotortium
Copy link
Collaborator

How odd. What's in the variable plstore-passphrase-alist (obviously redact your password)?

@nshi
Copy link
Author

nshi commented Nov 30, 2022

How odd. What's in the variable plstore-passphrase-alist (obviously redact your password)?

It's set to nil. This might be the issue. It's not remembering the password for some reason.

@telotortium
Copy link
Collaborator

That's strange. As long as you successfully enter your password at that prompt, it should save it. The prompt does say "Passphrase for PLSTORE", right?

@nshi
Copy link
Author

nshi commented Nov 30, 2022

That might be the problem. It doesn't say for plstore. Here's the popup dialog I get.
image

@telotortium
Copy link
Collaborator

Yeah, I don't have that. It looks like you have some GTK Emacs, maybe on Ubuntu? I don't know what customizations they made there. They probably want to ensure plstore uses the system password manager. However, I'm not sure how they've installed that support.

I would first try checking "Save in password manager" and see if that helps.

If that doesn't help, try running M-x edebug-defun on plstore-passphrase-callback-function to see if that function is even called. This is the relevant part of the backtrace for me on my computer:

  plstore-passphrase-callback-function
  epg--status-GET_HIDDEN
  epg--process-filter
  epg-wait-for-status
  epg-start-decrypt
  epg-decrypt-string
  plstore--decrypt
  plstore-get
  oauth2-auto--plstore-read

So another workaround is to figure out how to use epg as the plstore backend instead of your system password manager - not ideal, but it will help.

@seblemaguer
Copy link

seblemaguer commented Dec 5, 2022

I had the same problem and using "Save in password manager" helped

@nshi
Copy link
Author

nshi commented Dec 6, 2022

I tried "Save in password manager", it seems to work temporarily within several minutes of the save. When I try to sync again an hour or two later, it asks for password again.

My issue looks very similar to the one reported here. I tried unsetting the environment variable GPG_AGENT_INFO in my init.el to no avail.

@franburstall
Copy link

I am also having this issue and seeing the same dialogue on debian-11 with emacs-28.2 built from source (so no ubuntu customisations present).

Other data points: I have a gpg-agent running and /usr/bin/pinentry points to /usr/bin/pinentry-gnome3.

This is made more unpleasant by the fact that I also run EXWM as my window manager and the pinentry dialogue freezes that until I spam ESC.

@seblemaguer
Copy link

@nshi and @franburstall I just realized my pinentry mode variable was set to nil and set it to 'loopback:

(setq epg-pinentry-mode 'loopback)

everything happens in emacs then (no dialog)

@franburstall
Copy link

franburstall commented Dec 10, 2022 via email

@nshi
Copy link
Author

nshi commented Dec 12, 2022

@nshi and @franburstall I just realized my pinentry mode variable was set to nil and set it to 'loopback:

(setq epg-pinentry-mode 'loopback)

everything happens in emacs then (no dialog)

Thank you so much, @seblemaguer. This solved the problem.

@megodoonch
Copy link

Can I still comment here? I still have this problem (together with the reauthentication in issue #227). I'm running GTK Emacs on Ubuntu, so I guess it has something to do with GPG (PGP??).

This is the relevant part of my .emacs:

(require 'org-gcal)
(setq epg-pinentry-mode 'loopback)
(setenv "GPG_AGENT_INFO")
(setq-default plstore-cache-passphrase-for-symmetric-encryption t)

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

5 participants