unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* strange 400 Bad Request with Emacs 26 and GNU ELPA
@ 2021-10-20 16:47 Paul Pogonyshev
  0 siblings, 0 replies; only message in thread
From: Paul Pogonyshev @ 2021-10-20 16:47 UTC (permalink / raw)
  To: Emacs developers


[-- Attachment #1.1: Type: text/plain, Size: 962 bytes --]

Hi,

recently a bug has been reported to me (it is marked as closed
now, but only in Eldev itself, in that I added a workaround for
it):

    https://github.com/doublep/eldev/issues/52

I managed to reduce the way to reproduce it to a fairly short piece of
Elisp code that doesn't depend on Eldev, i.e. is "pure". The
workaround I used is also present in the attached script, but
commented out.

In short:
- run attached script as

    $ emacs --batch --load bad-request.el

  using Emacs 26.x (important!);

- observe that it dies with error
  "https://elpa.gnu.org/packages/org-edna-1.1.2.tar: Bad Request"

The script tries two install two packages (Org and Org-edna) from GNU
ELPA.  The second download dies with the error shown above.  If the
workaround line is uncommented, i.e. if HTTP(S) connection to GNU ELPA
is *not* reused for downloading the second package, it succeeds.

I'm not sure if it is a bug with GNU ELPA, Emacs 26 or something else.

Paul

[-- Attachment #1.2: Type: text/html, Size: 1288 bytes --]

[-- Attachment #2: bad-request.el --]
[-- Type: text/x-emacs-lisp, Size: 569 bytes --]

(require 'package)

(delete-directory "/tmp/400-bad-request" t)

(setf user-emacs-directory "/tmp/400-bad-request/.emacs"
      package-user-dir "/tmp/400-bad-request/elpa"
      package-archives '(("gnu" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(package-refresh-contents)
(package-read-all-archive-contents)

(let ((inhibit-message t))
  (package-install-from-archive (cadr (assq 'org package-archive-contents)))
  ;(clrhash url-http-open-connections)  ; WORKAROUND
  (package-install-from-archive (cadr (assq 'org-edna package-archive-contents))))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-20 16:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 16:47 strange 400 Bad Request with Emacs 26 and GNU ELPA Paul Pogonyshev

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).