bbatsov / prelude

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.
https://prelude.emacsredux.com
5.12k stars 1.86k forks source link

rainbow-mode preventing proper startup after initial install #1339

Open strickvl opened 3 years ago

strickvl commented 3 years ago

Expected behavior

After a fresh install of prelude I want emacs to open without errors.

Actual behavior

I get an error message while prelude is loading up that first time after the fresh install.

Steps to reproduce the problem

I just did a fresh install of prelude using the instructions here.

I then opened emacs and immediately saw the following error message:

Failed to verify signature rainbow-mode-1.0.5.el.sig:
No public key for 066DAFCB81E42C40 created at 2020-07-28T23:05:01+0200 using RSA
Command output:
gpg: keyblock resource '/Users/strickvl/.emacs.d/elpa/gnupg/pubring.kbx': No such file or directory
gpg: Signature made Tue 28 Jul 23:05:01 2020 CEST
gpg:                using RSA key C433554766D3DDC64221BFAA066DAFCB81E42C40
gpg: Can't check signature: No public key

I looked into the elpa folder and indeed there is no such public key (or indeed any gnupg folder) there.

I then restarted emacs in debug mode (--debug-init) and got the following extra information:

Debugger entered--Lisp error: (bad-signature "rainbow-mode-1.0.5.el.sig")
  signal(bad-signature ("rainbow-mode-1.0.5.el.sig"))
  package--check-signature-content("\211\1\263\4\0\1\n\0\35\26!\4\3043UGf\323\335\306B!\277\252\6m\257\313\201\344,@\5\2_ \222\375\0\n\11\20\6m\257\313\201\344,@..." ";;; rainbow-mode.el --- Colorize color names in bu..." "rainbow-mode-1.0.5.el.sig")
  #f(compiled-function () #<bytecode 0x1fe26460b0a5>)()
  package--with-response-buffer-1("https://elpa.gnu.org/packages/" #f(compiled-function () #<bytecode 0x1fe26460b0a5>) :file "rainbow-mode-1.0.5.el.sig" :async nil :error-function #f(compiled-function () #<bytecode 0x1fe26460b0d1>) :noerror t)
  package--check-signature("https://elpa.gnu.org/packages/" "rainbow-mode-1.0.5.el" ";;; rainbow-mode.el --- Colorize color names in bu..." nil #f(compiled-function (&optional good-sigs) #<bytecode 0x1fe26460b071>))
  #f(compiled-function () #<bytecode 0x1fe254da1cbd>)()
  package--with-response-buffer-1("https://elpa.gnu.org/packages/" #f(compiled-function () #<bytecode 0x1fe254da1cbd>) :file "rainbow-mode-1.0.5.el" :async nil :error-function #f(compiled-function () #<bytecode 0x1fe26441e2f9>) :noerror nil)
  package-install-from-archive(#s(package-desc :name rainbow-mode :version (1 0 5) :summary "Colorize color names in buffers" :reqs nil :kind single :archive "gnu" :dir nil :extras ((:url . "http://elpa.gnu.org/packages/rainbow-mode.html") (:keywords "faces") (:authors ("Julien Danjou" . "julien@danjou.info")) (:maintainer "Julien Danjou" . "julien@danjou.info")) :signed nil))
  mapc(package-install-from-archive (#s(package-desc :name rainbow-mode :version (1 0 5) :summary "Colorize color names in buffers" :reqs nil :kind single :archive "gnu" :dir nil :extras ((:url . "http://elpa.gnu.org/packages/rainbow-mode.html") (:keywords "faces") (:authors ("Julien Danjou" . "julien@danjou.info")) (:maintainer "Julien Danjou" . "julien@danjou.info")) :signed nil)))
  package-download-transaction((#s(package-desc :name rainbow-mode :version (1 0 5) :summary "Colorize color names in buffers" :reqs nil :kind single :archive "gnu" :dir nil :extras ((:url . "http://elpa.gnu.org/packages/rainbow-mode.html") (:keywords "faces") (:authors ("Julien Danjou" . "julien@danjou.info")) (:maintainer "Julien Danjou" . "julien@danjou.info")) :signed nil)))
  package-install(rainbow-mode)
  prelude-require-package(rainbow-mode)
  mapc(prelude-require-package (elisp-slime-nav rainbow-mode))
  prelude-require-packages((elisp-slime-nav rainbow-mode))
  eval-buffer(#<buffer  *load*-591313> nil "/Users/strickvl/.emacs.d/modules/prelude-emacs-lis..." nil t)  ; Reading at buffer position 1183
  load-with-code-conversion("/Users/strickvl/.emacs.d/modules/prelude-emacs-lis..." "/Users/strickvl/.emacs.d/modules/prelude-emacs-lis..." nil t)
  require(prelude-emacs-lisp)
  eval-buffer(#<buffer  *load*-368014> nil "/Users/strickvl/.emacs.d/sample/prelude-modules.el" nil t)  ; Reading at buffer position 2566
  load-with-code-conversion("/Users/strickvl/.emacs.d/sample/prelude-modules.el" "/Users/strickvl/.emacs.d/sample/prelude-modules.el" nil nil)
  load("/Users/strickvl/.emacs.d/sample/prelude-modules.el")
  (if (file-exists-p prelude-modules-file) (load prelude-modules-file) (message "[Prelude] Missing personal modules file %s" prelude-modules-file) (message "[Prelude] Falling back to the bundled example file...") (message "[Prelude] You should copy this file to your person...") (load (expand-file-name "sample/prelude-modules.el" user-emacs-directory)))
  eval-buffer(#<buffer  *load*> nil "/Users/strickvl/.emacs.d/init.el" nil t)  ; Reading at buffer position 5704
  load-with-code-conversion("/Users/strickvl/.emacs.d/init.el" "/Users/strickvl/.emacs.d/init.el" t t)
  load("/Users/strickvl/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1fe2645196dd>) #f(compiled-function () #<bytecode 0x1fe2645196f5>) t)
  command-line()
  normal-top-level()

Environment & Version information

Emacs version

27.2

Operating system

MacOS 10.15.7

strickvl commented 3 years ago

I found a half-way fix for this issue.

At the beginning of ~/.emacs/init.el, add the following line to disable signature checking temporarily:

(setq package-check-signature nil)

Then open Emacs, press M-x and type package-refresh-contents to download packages info. Press M-x and type package-install then enter package name gnu-elpa-keyring-update.

This seems to have fixed things for me in the interim, but not sure if this issue should be closed as perhaps might affect others?

bbatsov commented 3 years ago

It's not something we can fix in Prelude, but I guess we can suggest this workaround in our documentation. I've noticed that often people run into issues with Emacs's gpg keys.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!