17

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
    (delete-process
     (gnutls-negotiate
      :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.

Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77

2 Answers2

4

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

https://github.com/nicferrier/elmarmalade/issues/55#issuecomment-75377455

Jade Faustus
  • 111
  • 7
  • I can accept this answer if the relevant information is extracted from the link as per http://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. – Matthew Piziak Mar 07 '15 at 22:57
2

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.

Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77