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

After updating, a warning message appears whenever any file is opened #6114

Closed
Pi-Cla opened this issue Feb 15, 2022 · 11 comments
Closed

After updating, a warning message appears whenever any file is opened #6114

Pi-Cla opened this issue Feb 15, 2022 · 11 comments
Labels
is:regression A bug introduced in a recent and unreleased change module:config/default Pertains to Doom's :config default module status:resolved Issue was addressed internally

Comments

@Pi-Cla
Copy link
Contributor

Pi-Cla commented Feb 15, 2022

What did you expect to happen?

I expected that I could open files without a warning popping up. I also expected the buffer displaying the file to be in the major mode corresponding to its file suffix.

What actually happened?

Emacs does not immediate jump to the opened file instead showing me this in the Warning buffer:

Error (doom-first-file-hook): Error running hook "global-git-commit-mode" because: (epg-error no usable configuration OpenPGP)

It still makes another buffer that has the opened file though. I just have to manually switch to it. The buffer however is by default set to the fundamental major mode rather than the major mode for its file suffix.
Backtrace:

Debugger entered--Lisp error: (epg-error "no usable configuration" OpenPGP)
  signal(epg-error ("no usable configuration" OpenPGP))
  epg-context--make(OpenPGP nil nil nil nil nil nil)
  epg-make-context()
  (let* ((context (epg-make-context)) (--cl-var-- (condition-case nil (progn (epg-list-keys context user-full-name 'public)) (error nil))) (key nil) (subkey nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key (car --cl-var--)) (setq subkey (car (epg-key-sub-key-list key))) (if (not (memq 'disabled (epg-sub-key-capability subkey))) (progn (if (< (or (epg-sub-key-expiration-time subkey) 0) (time-to-seconds)) (progn (setq --cl-var-- (cons ... --cl-var--)))))) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--))
  (if (string-empty-p user-full-name) nil (let* ((context (epg-make-context)) (--cl-var-- (condition-case nil (progn (epg-list-keys context user-full-name 'public)) (error nil))) (key nil) (subkey nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key (car --cl-var--)) (setq subkey (car (epg-key-sub-key-list key))) (if (not (memq 'disabled (epg-sub-key-capability subkey))) (progn (if (< (or ... 0) (time-to-seconds)) (progn (setq --cl-var-- ...))))) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--)))
  (or (default-value 'epa-file-encrypt-to) (if (string-empty-p user-full-name) nil (let* ((context (epg-make-context)) (--cl-var-- (condition-case nil (progn (epg-list-keys context user-full-name ...)) (error nil))) (key nil) (subkey nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key (car --cl-var--)) (setq subkey (car (epg-key-sub-key-list key))) (if (not (memq 'disabled (epg-sub-key-capability subkey))) (progn (if (< ... ...) (progn ...)))) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--))) user-mail-address)
  (set-default 'epa-file-encrypt-to (or (default-value 'epa-file-encrypt-to) (if (string-empty-p user-full-name) nil (let* ((context (epg-make-context)) (--cl-var-- (condition-case nil (progn ...) (error nil))) (key nil) (subkey nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key (car --cl-var--)) (setq subkey (car (epg-key-sub-key-list key))) (if (not (memq ... ...)) (progn (if ... ...))) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--))) user-mail-address))
  (progn (set-default 'epa-file-encrypt-to (or (default-value 'epa-file-encrypt-to) (if (string-empty-p user-full-name) nil (let* ((context (epg-make-context)) (--cl-var-- (condition-case nil ... ...)) (key nil) (subkey nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key (car --cl-var--)) (setq subkey (car ...)) (if (not ...) (progn ...)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--))) user-mail-address)))
  (progn (set 'epg-pinentry-mode 'loopback) (progn (set-default 'epa-file-encrypt-to (or (default-value 'epa-file-encrypt-to) (if (string-empty-p user-full-name) nil (let* ((context ...) (--cl-var-- ...) (key nil) (subkey nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key ...) (setq subkey ...) (if ... ...) (setq --cl-var-- ...)) (nreverse --cl-var--))) user-mail-address))) (progn (defalias '+default--dont-prompt-for-keys-a #'(lambda (&rest _) (if (local-variable-p 'epa-file-encrypt-to) nil (set (make-local-variable ...) (default-value ...))))) (let ((--dolist-tail-- (list (cons :before (doom-enlist ...))))) (while --dolist-tail-- (let ((targets (car --dolist-tail--))) (let ((--dolist-tail-- ...)) (while --dolist-tail-- (let ... ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
  (closure (t) nil (progn (set 'epg-pinentry-mode 'loopback) (progn (set-default 'epa-file-encrypt-to (or (default-value 'epa-file-encrypt-to) (if (string-empty-p user-full-name) nil (let* (... ... ... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--))) user-mail-address))) (progn (defalias '+default--dont-prompt-for-keys-a #'(lambda (&rest _) (if (local-variable-p ...) nil (set ... ...)))) (let ((--dolist-tail-- (list (cons :before ...)))) (while --dolist-tail-- (let ((targets ...)) (let (...) (while --dolist-tail-- ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))))))()
  eval-after-load-helper("/nix/store/akcl9khdvv0ygv3663xjwid4w69rk8fp-emacs-...")
  run-hook-with-args(eval-after-load-helper "/nix/store/akcl9khdvv0ygv3663xjwid4w69rk8fp-emacs-...")
  do-after-load-evaluation("/nix/store/akcl9khdvv0ygv3663xjwid4w69rk8fp-emacs-...")
  require(epa)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\307\310\311\"\210\307\312\313\"\210\307\314\313\"\210\307\315\316\"\210\307\317\316\"\210\307..." [require cl-lib gnus-util epg epa password-cache mm-encode autoload mail-strip-quoted-names "mail-utils" mml2015-sign "mml2015" mml2015-encrypt mml1991-sign "mml1991" mml1991-encrypt message-fetch-field "message" message-goto-body message-options-get mml-insert-tag "mml" mml-smime-sign "mml-smime" mml-smime-encrypt mml-smime-sign-query mml-smime-encrypt-query mml-smime-verify mml-smime-verify-test epa--select-keys "epa" message-options-set] 3)
  require(mml-sec)
  byte-code("\301\302!\210\301\303!\210\301\304!\210\301\305!\210\301\306!\210\307\310\311\"\210\307\312\313\"\210\307\314\311\"\210\307\315\311\"\210\307\316\311\"\210\307\317\320\"\210..." [dispositions require mm-util mm-bodies mm-encode mm-decode mml-sec autoload message-make-message-id "message" gnus-completing-read "gnus-util" message-fetch-field message-mark-active-p message-info fill-flowed-encode "flow-fill" message-posting-charset dnd-get-local-file-name "dnd" message-options-set message-narrow-to-head message-in-body-p message-mail-p custom-declare-variable mml-content-type-parameters '(name access-type expiration size permission format) "A list of acceptable parameters in MML tag.\nThese ..." :version "22.1" :type (repeat (symbol :tag "Parameter")) :group message mml-content-disposition-parameters '(filename creation-date modification-date read-date) "A list of acceptable parameters in MML tag.\nThese ..." (repeat (symbol :tag "Parameter")) mml-content-disposition-alist '((text (rtf . "attachment") (t . "inline")) (t . "attachment")) "Alist of MIME types or regexps matching file names..." "23.1" (radio :format "DISPOSITION: %v" :value "attachment" (const :format "%v " "attachment") (const :format "%v\n" "inline")) repeat :offset 0 choice :format "%[Value Menu%]%v" cons ...] 34)
  require(mml)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\300\312!\210\300\313!\210\300\314!\210\300\315..." [require cl-lib mailheader gmm-utils mail-utils mailabbrev mail-parse mml rfc822 format-spec dired mm-util rfc2047 puny rmc autoload mailclient-send-it "mailclient" custom-declare-group message ((user-mail-address custom-variable) (user-full-name custom-variable)) "Mail and news message composing." :link (custom-manual "(message)Top") :group mail news message-various nil "Various Message Variables." (custom-manual "(message)Various Message Variables") message-buffers "Message Buffers." (custom-manual "(message)Message Buffers") message-sending "Message Sending." (custom-manual "(message)Sending Variables") message-interface "Message Interface." (custom-manual "(message)Interface") message-forwarding "Message Forwarding." (custom-manual "(message)Forwarding") message-insertion "Message Insertion." (custom-manual "(message)Insertion") message-headers "Message Headers." (custom-manual "(message)Message Headers") message-news ...] 14)
  require(message)
  byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\310\311\312\311\313\314\315\316\317&\13\207" [require add-log pcvs-util ring message custom-declare-group log-edit nil "Major mode for editing RCS and CVS commit messages..." :group pcl-cvs vc :version "21.1" :prefix "log-edit-"] 12)
  require(log-edit)
  byte-code("\300\301!\210\300\302!\210\300\303\304\305#\210\300\306\304\305#\210\300\307\304\305#\210\300\310!\210\300\311!\210\300\312!\210\300\313!\210\300\314!\210\300\315!\210..." [require seq subr-x magit-git nil t magit-mode magit-utils log-edit ring rx server transient with-editor custom-declare-group git-commit "Edit Git commit messages." :prefix "git-commit-" :link (info-link "(magit)Editing Commit Messages") :group tools custom-declare-variable global-git-commit-mode funcall function #f(compiled-function () #<bytecode 0x2139169>) "Non-nil if Global Git-Commit mode is enabled.\nSee ..." :set custom-set-minor-mode :initialize #f(compiled-function (symbol exp) #<bytecode 0x21ed00d>) :type boolean] 12)
  global-git-commit-mode()
  funcall(global-git-commit-mode)
  (condition-case e (funcall hook) ((debug error) (signal 'doom-hook-error (list hook e))))
  doom-run-hook(global-git-commit-mode)
  run-hook-wrapped(doom-run-hook global-git-commit-mode)
  (condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if (symbolp (car (cdr e))) (symbol-name (car (cdr e))) (car (cdr e))) (car (cdr (cdr e))))) (signal 'doom-hook-error (cons hook (cdr e)))))
  (let ((hook (car --dolist-tail--))) (condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if (symbolp (car ...)) (symbol-name (car ...)) (car (cdr e))) (car (cdr (cdr e))))) (signal 'doom-hook-error (cons hook (cdr e))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((hook (car --dolist-tail--))) (condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if (symbolp ...) (symbol-name ...) (car ...)) (car (cdr ...)))) (signal 'doom-hook-error (cons hook (cdr e))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((--dolist-tail-- hooks)) (while --dolist-tail-- (let ((hook (car --dolist-tail--))) (condition-case e (run-hook-wrapped hook #'doom-run-hook) ((debug doom-hook-error) (if debug-on-error nil (lwarn hook :error "Error running hook %S because: %s" (if ... ... ...) (car ...))) (signal 'doom-hook-error (cons hook (cdr e))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  doom-run-hooks(doom-first-file-hook)
  (progn (doom-run-hooks hook-var) (set hook-var nil))
  (if (and after-init-time (or (daemonp) (and (boundp hook) (symbol-value hook)))) (progn (doom-run-hooks hook-var) (set hook-var nil)))
  doom-first-file-hook-init-on-find-file-hook-h(nil t)
  apply(doom-first-file-hook-init-on-find-file-hook-h (nil t))
  after-find-file(nil t)
  find-file-noselect-1(#<buffer init.el> "~/.doom.d/init.el" nil nil "~/.doom.d/init.el" (21102718 66307))
  find-file-noselect("~/.doom.d/init.el" nil nil t)
  find-file("~/.doom.d/init.el" t)
  #<subr funcall-interactively>(find-file "~/.doom.d/init.el" t)
  apply(#<subr funcall-interactively> (find-file "~/.doom.d/init.el" t))
  funcall-interactively(find-file "~/.doom.d/init.el" t)
  #<subr call-interactively>(find-file nil nil)
  apply(#<subr call-interactively> (find-file nil nil))
  explain-pause--wrap-call-interactively(#<subr call-interactively> find-file nil nil)
  apply(explain-pause--wrap-call-interactively #<subr call-interactively> (find-file nil nil))
  call-interactively(find-file nil nil)
  command-execute(find-file)

Describe your attempts to resolve the issue

I commented out some default lines in config.el that set gpg stuff:

;;(setq user-full-name "John Doe"
;;      user-mail-address "john@doe.com")

And this does seem to fix all the problems for me at least.

Steps to reproduce

  1. Update Doom Emacs to at least dcae28c
  2. Open any file using Emacs

System Information

https://pastebin.com/rFWBqnr5

@Pi-Cla Pi-Cla added is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels Feb 15, 2022
@Pi-Cla
Copy link
Contributor Author

Pi-Cla commented Feb 15, 2022

A contributing factor may also be that I don't have gnupg installed on this system. Idk

@bhankas
Copy link
Contributor

bhankas commented Feb 15, 2022

I can confirm this happening with dcae28c on NixOS unstable. Reverting before it resolved the issue.

I also don't have gnupg installed and never did, and it shouldn't really be necessary to use Emacs as a daily tool for non-security-sensitive work.

Pi-Cla referenced this issue Feb 15, 2022
And don't use the short ID (see evil32.com).

Ref: https://evil32.com/
@teehemkay
Copy link

I just did a doom up and I'm also seeing the same error every time I try to open a file which essentially makes doom unusable.
I'm using nix-darwin, don't have gnupg installed and never did either.

My config:

> Executing 'doom info' with Emacs 27.2 at 2022-02-15 09:40:06
    generated    Feb 15, 2022 09:40:06
      system       MacOS 12.2.1 Darwin 21.3.0 arm64
      emacs        27.2 master fd9696b26 ~/hacking/doom-emacs/ -> ~/hacking/doom-emacs/
      doom         21.12.0-alpha HEAD -> master fc868105c 2022-02-14 21:24:46 +0100 ~/.config/doom/ -> ~/.config/doom/
      shell        /run/current-system/sw/bin/fish
      features     NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER
      traits       batch server-running envvar-file
      modules      :completion (company +childframe) (vertico +icons) :ui doom doom-dashboard doom-quit (emoji +ascii +github +unicode) hl-todo minimap (modeline +light) nav-flash ophints (popup +defaults) treemacs unicode vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold format multiple-cursors (parinfer +rust) rotate-text snippets word-wrap :emacs (dired +ranger +icons) electric (ibuffer +icons) (undo +tree) vc :term eshell vterm :checkers syntax :tools direnv (eval +overlay) (lookup +dictionary +docsets) lsp magit pdf :os macos :lang (clojure +lsp) data (elm +lsp) emacs-lisp (javascript +lsp) (json +lsp) ledger markdown nix (org +brain +dragndrop +gnuplot +journal +noter +pandoc +pomodoro +present +roam2) racket (sh +lsp +fish) (web +lsp) (yaml +lsp) :app everywhere :config (default +bindings +smartparens)
      packages     (pdf-tools :recipe (:type built-in)) (hercules) (nov) (atomic-chrome) (pnpm-mode)

@jlcolbert
Copy link

This was fixed for me when I installed gnupg and set up keys.

@teehemkay
Copy link

@jlcolbert thanks for the work around. Still, I'd rather not have to install and setup gnupg to be able to use doom :-)

@lread
Copy link

lread commented Feb 15, 2022

@jlcolbert thanks for the tip, I only installed gnupg, I did not seem to need to set up any keys.

@jlcolbert
Copy link

@jlcolbert thanks for the tip, I only installed gnupg, I did not seem to need to set up any keys.

Good to know. I already had keys set up (I've been revamping my work computer), so I didn't get a chance to test without.

@pinacle2000
Copy link

pinacle2000 commented Feb 15, 2022

I just did a doom up and I'm also seeing the same error every time I try to open a file which essentially makes doom unusable. I'm using nix-darwin, don't have gnupg installed and never did either.

I got similar problem but I use windows. Now doom loads with this error that makes it doesn't respond any key stroke:
condition-case: Error in a Doom startup hook: emacs-startup-hook, doom-load-packages-incrementally-h, (epg-error "no usable configuration" OpenPGP)
I don't use PGP and therefore don't want to install it.

@Pi-Cla
Copy link
Contributor Author

Pi-Cla commented Feb 15, 2022

I just did a doom up and I'm also seeing the same error every time I try to open a file which essentially makes doom unusable. I'm using nix-darwin, don't have gnupg installed and never did either.

I got similar problem but I use windows. Now doom loads with this error that makes it doesn't respond any key stroke: condition-case: Error in a Doom startup hook: emacs-startup-hook, doom-load-packages-incrementally-h, (epg-error "no usable configuration" OpenPGP)

I don't use PGP and therefore don't want to install it. Can I speicify an older version of doom when I perform doom update?

Have you tried commenting out the two lines from your config.el like the github issue says?

;;(setq user-full-name "John Doe"
;;      user-mail-address "john@doe.com")

The file can be found in /.doom.d/config.el
Lines are commented out with ;;

@pinacle2000
Copy link

Have you tried commenting out the two lines from your config.el like the github issue says?

;;(setq user-full-name "John Doe"
;;      user-mail-address "john@doe.com")

The file can be found in /.doom.d/config.el Lines are commented out with ;;

Didn't try. I checked the doom commit list and rolled back the epa configruation in \modules\config\default\config.el. Now it works fine.

@hlissner hlissner added is:regression A bug introduced in a recent and unreleased change status:resolved Issue was addressed internally module:config/default Pertains to Doom's :config default module and removed is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels Feb 16, 2022
@hlissner hlissner added this to the v21.12 milestone Feb 16, 2022
@hlissner
Copy link
Member

hlissner commented Feb 16, 2022

This was a regression caused by dcae28c. This error will occur when you don't have a PGP environment set up. As of 26d5163 this issue should be resolved. Let me know if that isn't the case and I'll reopen it. Thanks for bringing it to my attention!

shelper pushed a commit to shelper/doom-emacs that referenced this issue Feb 17, 2022
Introduced in dcae28c, because ignore-errors was being used for the
wrong epg-* function.

Why this happens: epg-make-context throws this error if you don't have a
GnuPG environment set up.

Fix: doomemacs#6114
Amend: dcae28c
Sneaksolid pushed a commit to Sneaksolid/doom-emacs that referenced this issue Apr 13, 2022
Introduced in dcae28c, because ignore-errors was being used for the
wrong epg-* function.

Why this happens: epg-make-context throws this error if you don't have a
GnuPG environment set up.

Fix: doomemacs#6114
Amend: dcae28c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:regression A bug introduced in a recent and unreleased change module:config/default Pertains to Doom's :config default module status:resolved Issue was addressed internally
Projects
None yet
Development

No branches or pull requests

7 participants