Subject: bug#48905: 28.0.50; list-packages fails trying to contact an internal server

From: Sam Steingold <[email-masked]>
Date: Mon, 21 Jun 2021 10:27:49 -0400

Got the error again.

(current-buffer) is "*Packages*".
default-directory in "*Packages*" is a regular local directory (same
as that of a buffer from which list-packages was called)

Debugger entered--Lisp error: (error "ip-10-0-37-237.ec2.internal/8081
nodename nor serv...")
  signal(error ("ip-10-0-37-237.ec2.internal/8081 nodename nor serv..."))
  (if noerror nil (signal (car err) (cdr err)))
  (condition-case err (progn (url-retrieve url #'(lambda (status) (let
((b ...)) (require 'url-handlers) (let (...) (save-current-buffer ...
...)))) nil 'silent) t) (error (funcall error-function) (if noerror
nil (signal (car err) (cdr err)))))
  (if (condition-case err (progn (url-retrieve url #'(lambda (status)
(let (...) (require ...) (let ... ...))) nil 'silent) t) (error
(funcall error-function) (if noerror nil (signal (car err) (cdr
err))))) (progn (ignore)))
  (progn (set-buffer-multibyte nil) (if (condition-case err (progn
(url-retrieve url #'(lambda (status) (let ... ... ...)) nil 'silent)
t) (error (funcall error-function) (if noerror nil (signal (car err)
(cdr err))))) (progn (ignore))))
  (unwind-protect (progn (set-buffer-multibyte nil) (if
(condition-case err (progn (url-retrieve url #'(lambda ... ...) nil
'silent) t) (error (funcall error-function) (if noerror nil (signal
(car err) (cdr err))))) (progn (ignore)))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(set-buffer-multibyte nil) (if (condition-case err (progn
(url-retrieve url #'... nil 'silent) t) (error (funcall
error-function) (if noerror nil (signal ... ...)))) (progn (ignore))))
(and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*" t)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(set-buffer-multibyte nil) (if (condition-case err (progn
(url-retrieve url ... nil ...) t) (error (funcall error-function) (if
noerror nil ...))) (progn (ignore)))) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer)))))
  (if async (let ((temp-buffer (generate-new-buffer " *temp*" t)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(set-buffer-multibyte nil) (if (condition-case err (progn ... t)
(error ... ...)) (progn (ignore)))) (and (buffer-name temp-buffer)
(kill-buffer temp-buffer))))) (let ((temp-buffer (generate-new-buffer
" *temp*" t))) (save-current-buffer (set-buffer temp-buffer)
(unwind-protect (progn (set-buffer-multibyte nil) (if (condition-case
err (progn ... t) (error ... ...)) (progn (funcall body)))) (and
(buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  (let ((url (concat url file))) (if async (let ((temp-buffer
(generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn (set-buffer-multibyte nil) (if
(condition-case err ... ...) (progn ...))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer))))) (let ((temp-buffer
(generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn (set-buffer-multibyte nil) (if
(condition-case err ... ...) (progn ...))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer)))))))
  (if (string-match-p "\\`https?:" url) (let ((url (concat url file)))
(if async (let ((temp-buffer (generate-new-buffer " *temp*" t)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(set-buffer-multibyte nil) (if ... ...)) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer))))) (let ((temp-buffer
(generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn (set-buffer-multibyte nil) (if ...
...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))
(let ((temp-buffer (generate-new-buffer " *temp*" t)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
(set-buffer-multibyte nil) (if (condition-case err (progn ... t)
(error ... ...)) (progn (funcall body)))) (and (buffer-name
temp-buffer) (kill-buffer temp-buffer))))))
  (let* ((async (car (cdr (plist-member --cl-rest-- ':async)))) (file
(car (cdr (plist-member --cl-rest-- ':file)))) (error-function (car
(cdr (plist-member --cl-rest-- ':error-function)))) (noerror (car (cdr
(plist-member --cl-rest-- ':noerror))))) (if (string-match-p
"\\`https?:" url) (let ((url (concat url file))) (if async (let
((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer
(set-buffer temp-buffer) (unwind-protect (progn ... ...) (and ...
...)))) (let ((temp-buffer (generate-new-buffer " *temp*" t)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
... ...) (and ... ...)))))) (let ((temp-buffer (generate-new-buffer "
*temp*" t))) (save-current-buffer (set-buffer temp-buffer)
(unwind-protect (progn (set-buffer-multibyte nil) (if (condition-case
err ... ...) (progn ...))) (and (buffer-name temp-buffer) (kill-buffer
temp-buffer)))))))
  package--with-response-buffer-1("https://melpa.org/packages/"
(closure ((async . t) (file . "archive-contents") (archive "melpa" .
"https://melpa.org/packages/") cl-struct-package--ac-desc-tags
autoload-timestamps tar-parse-info cl-struct-package--bi-desc-tags
cl-struct-package-desc-tags t) nil (let* ((location (cdr archive))
(name (car archive)) (content (buffer-string)) (dir (expand-file-name
(concat "archives/" name) package-user-dir)) (local-file
(expand-file-name file dir))) (if (listp (read content)) (progn
(make-directory dir t) (if (or (not ...) (member name
package-unsigned-archives)) (progn (progn ... nil) (let ... ...)
(package--update-downloads-in-progress archive))
(package--check-signature location file content async #'...
#'...)))))) :file "archive-contents" :async t :error-function (closure
((async . t) (file . "archive-contents") (archive "melpa" .
"https://melpa.org/packages/") cl-struct-package--ac-desc-tags
autoload-timestamps tar-parse-info cl-struct-package--bi-desc-tags
cl-struct-package-desc-tags t) nil
(package--update-downloads-in-progress archive)) :noerror nil)
  package--download-one-archive(("melpa" .
"https://melpa.org/packages/") "archive-contents" t)
  (condition-case nil (package--download-one-archive archive
"archive-contents" async) ((debug error) (message "Failed to download
`%s' archive." (car archive))))
  (let ((archive (car --dolist-tail--))) (condition-case nil
(package--download-one-archive archive "archive-contents" async)
((debug error) (message "Failed to download `%s' archive." (car
archive)))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (while --dolist-tail-- (let ((archive (car --dolist-tail--)))
(condition-case nil (package--download-one-archive archive
"archive-contents" async) ((debug error) (message "Failed to download
`%s' archive." (car archive)))) (setq --dolist-tail-- (cdr
--dolist-tail--))))
  (let ((--dolist-tail-- package-archives)) (while --dolist-tail--
(let ((archive (car --dolist-tail--))) (condition-case nil
(package--download-one-archive archive "archive-contents" async)
((debug error) (message "Failed to download `%s' archive." (car
archive)))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  package--download-and-read-archives(t)
  package-refresh-contents(t)
  package-menu--refresh-contents()
  (if no-fetch nil (package-menu--refresh-contents))
  (save-current-buffer (set-buffer buf) (setq
buffer-file-coding-system 'utf-8) (package-menu-mode) (if no-fetch nil
(package-menu--refresh-contents)) (if package-menu-async (progn
(package-menu--generate nil t))))
  (let ((buf (get-buffer-create "*Packages*"))) (save-current-buffer
(set-buffer buf) (setq buffer-file-coding-system 'utf-8)
(package-menu-mode) (if no-fetch nil (package-menu--refresh-contents))
(if package-menu-async (progn (package-menu--generate nil t))))
(pop-to-buffer-same-window buf))
  list-packages(nil)

in " *temp*" buffer, default-directory is the same as in *Packages*.

On Tue, 8 Jun 2021 at 08:07, Lars Ingebrigtsen <[email-masked]> wrote:
>
> Steingold <[email-masked]> writes:
>
> > I get this error on M-x list-packages:
> >
> > Debugger entered--Lisp error: (error "ip-10-0-37-237.ec2.internal/8081 nodename nor serv...")
> >   signal(error ("ip-10-0-37-237.ec2.internal/8081 nodename nor serv..."))
> >   package--with-response-buffer-1("https://elpa.gnu.org/packages/" #f(compiled-function () #<bytecode 0x185414f4e5c4fd07>) :file "archive-contents" :async t :error-function #f(compiled-function () #<bytecode -0x1a9d4fb09851cb13>) :noerror nil)
>
> [...]
>
> > ip-10-0-37-237.ec2.internal is an internal server that is not available
> > ATM and has nothing to do with emacs packages (it's a jupyter server
> > accessed by ein).
>
> Very odd -- it sounds like `package--with-response-buffer-1' is possibly
> working in the wrong buffer or something along those lines?
>
> To debug, could you try `e (current-buffer) RET' to see what the buffer
> is at this point?  And could you also try loading and uncompiled
> package.el to get a more detailed backtrace?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net>
<http://steingoldpsychology.com>