Closed mirkov closed 2 years ago
I was able to reproduce this issue in bare Emacs (emacs -Q) by issuing the 'package-list' command.
I have submitted a bug report to the Emacs maintainers link
I propose to leave this issue open until I get some resolution. I can then close it with a link on how it got resolved.
If Spacemacs maintainers feel differently, please proceed as you prefer.
I have the following in my early-init.el:
(setq package-check-signature nil)
I don't know whether this would help you, but it might be worth trying.
Your advice worked. Thank you :-)
I added that snippet into the dotspacemacs/user-init
part of my init.el
, and Spacemacs downloaded the required packages and started succesfully.
Assuming this isssue is not related to some details of my laptop setup, it still requires a fix of some kind. Either it is an Emacs 27.1 fix, or Spacemacs' default init.el template will set this variable to nil
.
Cryptographic signing of packages is a new feature of 27. It is then not surprising that maintainers of melpa or other archives have not yet made the required changes. There could also be other issues such as missing programs to check the signatures or misconfiguation of some tools.
I'm sure things will improved over the next few months for everyone to adopt. Signature checking perhaps can be enabled then.
This issue does not impact me, since I build all my packages myself, i.e., I create something like MELPA on my own local machine, and install. Thus I never install packages that I have not built myself. That is why I felt that it was safe for me to disable signature checking altogether.
Just to emphasise the nature of the error I encountered: gpg failed when the pathname was a concatenation of a Posix current working directory and Windows target path (with forward slashes), e.g., /c/Users/977315/tmp/c:/Users/977315/.emacs.d/elpa/gnupg/pubring.kbx
I see. This then looks like a problem specific to your setup or your OS. I used cygwin in 1990's, but I have not used WIndows for over 10 years (other than being conduit to access other OS'es), so I'm afraid I can't help you. I'm clueless what MSYS2, WSL, etc are. On GNU/Linux I would have suggested examining TMPDIR or similar environment variables, but I doubt that matters for you.
Seeing the same issue here when trying to update the package list with a working Spacemacs. when trying to get the key:
gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
gpg: keyserver receive failed: General error
I encounter the same issue, too, right after installing Spacemacs and updating packages:
Failed to verify signature archive-contents.sig:
No public key for 066DAFCB81E42C40 created at 2020-11-12T05:05:03-0500 using RSA
Command output:
gpg: keyblock resource '/c/Program Files/Emacs/c:/Users/flcon/AppData/Roaming/.emacs.d/elpa/gnupg/pubring.kbx': No such file or directory
gpg: Signature made Thu Nov 12 05:05:03 2020 EST
gpg: using RSA key C433554766D3DDC64221BFAA066DAFCB81E42C40
gpg: Can't check signature: No public key
Seems to be a path issue: /c/Program Files/Emacs/c:/Users/flcon/AppData/Roaming/.emacs.d/elpa/gnupg/pubring.kbx
.
I was able to update the GPG key adding the keyserver
argument to gpg
gpg --homedir ~/.emacs.d/elpa/gnupg --keyserver hkp://keys.gnupg.net --recv-keys 066DAFCB81E42C40
WIth that, the elpa archive gets updated. But melpa and org archives do not:
(Spacemacs) --> refreshing package archive: melpa... [1/3]
Contacting host: melpa.org:443
Importing package-keyring.gpg...done
Contacting host: melpa.org:443 [2 times]
Package refresh done
Failed to download ‘melpa’ archive. <<<<<<<<<
(Spacemacs) --> refreshing package archive: org... [2/3]
Importing package-keyring.gpg...done
Contacting host: orgmode.org:443
Package refresh done
Failed to download ‘org’ archive. <<<<<<<<<
(Spacemacs) --> refreshing package archive: gnu... [3/3]
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:443
Package refresh done
As result of that, spacemacs would not load 15 packages. I had to package-inatall
them manually:
(setq package-check-signature nil)
package-install
each pacakgeShouldn't the path have ".gnupg" with a dot?. Without the dot I get a "No such file or directory..." error (several actually).
gpg --homedir ~/.emacs.d/elpa/gnupg --receive-keys 066DAFCB81E42C40
gives
gpg: keyblock resource '/Users/silas/.emacs.d/elpa/gnupg/pubring.kbx': No such file or directory
gpg: failed to create temporary file '/Users/silas/.emacs.d/elpa/gnupg/.#lk0x00007fa65ec08820.Alastors-MacBook-Pro.local.4109': No such file or directory
gpg: connecting dirmngr at '/Users/silas/.emacs.d/elpa/gnupg/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
while
gpg --homedir ~/.emacs.d/elpa/.gnupg --receive-keys 066DAFCB81E42C40
gives
gpg: directory '/Users/silas/.emacs.d/elpa/.gnupg' created
gpg: keybox '/Users/silas/.emacs.d/elpa/.gnupg/pubring.kbx' created
gpg: /Users/silas/.emacs.d/elpa/.gnupg/trustdb.gpg: trustdb created
gpg: key 066DAFCB81E42C40: public key "GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org>" imported
gpg: Total number processed: 1
gpg: imported: 1
Checking my "~/.emacs.d/elpa" folder there is no "gnupg" folder inside.
Could it be that it's a keystroke error?. Or that the path is fine, but somewhere that folder should have been created and it wasn't?.
I just started using emacs, so I don't know which folders should exist and where.
Edit 1:
Trying to run my emacs again gives the same error, as if the keys had not been generated/obtained.
Somewhere I found that you could install the package "gnu-elpa-keyring-update" to help with this, but this had no effect for me, my emacs still fails to start, I'm stuck not even being able to run my first prelude boot.
On my laptop the path was without the dot from the start. In other words, the first time I looked for the pubring.kbx file on the laptop I did see the gnupg (without the dot) directory.
This morning I tried the following (see https://github.com/syl20bnr/spacemacs/issues/13866#issuecomment-732389015 and https://github.com/syl20bnr/spacemacs/issues/13866#issuecomment-732458389 as reference):
(setq package-check-signature nil)
install-package gnu-elpa-keyring-update
Following the second step, a bunch of keys were automatically added (I did not write down the messages).
Upon spacemacs restart, the warning messages in the Message buffer are gone and I do not get the Error buffer about the failure to load the archive-contents.sig
.
I believe this was suggested before by someone else, but I failed to read it carefully or comprehend its significance.
This issue may have been resolved (see Emacs Bug) which actually is not a bug but my (user) error. I do not claim 100% for it to be resolved until I figure out a way to test it on Spacemacs. (see below why I think it is resolved by testing in in plain Emacs.).
To repeat: this issue arose on Emacs 27.1 distributed for Windows via MSYS2/MinGW64.
To resolve this issue ensure the following:
For Emacs 27.1 to properly handle the archive signatures, it needs to access MinGW64's gnupg and not MSYS2's gnupg
See Eli Zaretskii's explanation why that is required (in the link above).
This issue manifested itself by starting plain emacs with the -Q switch (no customizations of any kind) and executing package-list-packages
. Now that emacs can find MinGW64's gnupg, the package list updates normally without any errors.
To install the correct version of gnupg, issue the following in MSYS2 shell:
pacman -S mingw64/mingw-w64-x86_64-gnupg
Then make sure that your PATH points to this gnupg and not the MSYS2 one:
> which gpg
/mingw64/bin/gpg
After this fix, my Spacemacs starts OK with no errors.
I will not close this issue as yet for just in case there is something else going on.
Thanks for your help, I was having this problem on and off (different $PATH
's) but the comment on the bug that you linked above about posix paths not recognizing the windows path got me thinking...
You can also set the package-gnupghome-dir
in your .spacemacs
with:
(setq package-gnupghome-dir "/c/users/<path to your .emacs>/elpa/gnupg")
note the unix style /c/
as we are running emacs through MSYS
It needs to be in the (defun dotspacemacs/user-init ()
function of your .spacemacs
so that it takes effect before the repos are checked.
If you're having trouble because a package isn't signed with the key you have yet you can temporarily set
(setq package-check-signature nil)
in the same place but that means you'll except any old signature so I wouldn't run like that permanently.
This was for win 7 and MSYS2 with the same incorrect windows path appended to a unix path.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
Description :octocat:
I run Emacs on MSYS2 & Windows10. This problem showed up after I updated MSYS2, which installed Emacs 27.1.
Reproduction guide :beetle:
Observed behaviour: :eyes: :broken_heart: Evil mode is not active. Editing in Emacs/holy mode.
*Error Buffer*
has a message.gpg is looking in a directory that does not exist, and whose name is the concatenation of the current directory and the target directory. Here are the contents of the
*Error Buffer*
:The
*Messages*
buffer shows package update notes, the failure to update the gnu archive and multiple failures to load packages:Expected behaviour: :heart: :smile: The awesome Spacemacs experience
SYSTEM_INFO:
Backtrace :paw_prints:
The backtrace captured when I do
emacs --debug-init