When running package-list-packages I get the following errors:

Failed to download `gnu' archive.
gnutls.c: [0] (Emacs) fatal error: The TLS connection was non-properly terminated.

I am running Emacs 24.4 on Windows. Until this week package downloads were happening normally.

I've tried this guide on setting up Emacs-GnuTLS-Windows. I tried running this code from the See if it works section:

(condition-case e
      :process (open-network-stream "test" nil "www.google.com" 443)
      :hostname "www.google.com"
      :verify-error t))
  (error e))

I do get nil inserted into the buffer, with no validation error, which according to the article is a sign of success. However, if I set (setq gnutls-log-level 2) and run the code again, I get the following output.

gnutls.c: [1] (Emacs) allocating credentials
gnutls.c: [2] (Emacs) allocating x509 credentials
gnutls.c: [2] (Emacs) using default verification flags
gnutls.c: [1] (Emacs) setting the trustfile:  c:/gnutls/cacert.pem
gnutls.c: [1] (Emacs) gnutls callbacks
gnutls.c: [1] (Emacs) gnutls_init
gnutls.c: [1] (Emacs) got non-default priority string: NORMAL
gnutls.c: [1] (Emacs) setting the priority string
gnutls.c: [audit] Note that the security level of the Diffie-Hellman key exchange has been lowered to 256 bits and this may allow decryption of the session data

gnutls.c: [1] (Emacs) non-fatal error: Resource temporarily unavailable, try again. [1428 times]
gnutls.c: [2] (Emacs) Deallocating x509 credentials

So that seems a bit odd. According to this mailing list, the error isn't usually harmful. Nevertheless, I still cannot download gnu.

How can I restore normal package fetching?

June update

Although there are some suggestions on GitHub that the error message is spurious, gnu still fails to fetch. I confirmed this by checking local package versions with recently updates to the online repository.

24.5 update

I can no longer reproduce the issue after upgrading to Emacs 24.5.

  • This just looks as if the repository was down (the server serving the packages was offline). Can you access the server by other means? (eg. via browser).
    – wvxvw
    Commented Feb 28, 2015 at 22:18
  • Yes. This is the repository: elpa.gnu.org/packages Commented Feb 28, 2015 at 23:11
  • I get the same kind of output, suggesting that this is not a sign of an error.
    – politza
    Commented Mar 2, 2015 at 22:39
  • That is also my impression, but I thought I should post it for completeness. Commented Mar 2, 2015 at 22:40
  • I get this error too but doesn't seem to cause any harm. Package fetches work fine. Commented Mar 3, 2015 at 1:00

2 Answers 2


This appears to be a bug with the interaction of some versions of emacs with some versions of gnutls:


  • I can accept this answer if the relevant information is extracted from the link as per meta.stackexchange.com/a/8259, and if the resulting answer is sufficient to give users with the same problem a decent chance of fixing it. Commented Mar 7, 2015 at 22:57

I can no longer reproduce the issue after upgrading to the the latest stable Emacs (currently 24.5). C-h N shows that a number of changes have been made to package signatures in that version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.