3
votes

I spent a day debugging it but can't see what's wrong in my setup. I'm using Linux (Fedora 22) running Emacs 24.5.1, behind company proxy and have environment variables "http_proxy", "https_proxy", "ftp_proxy" all setup correctly. I also have "setq url-proxy-services ..." in my init.el.

I added MELPA as a repository using: (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))

But emacs keeps throwing this stack trace on error (emacs --debug-init):

Debugger entered--Lisp error: (file-error "https://melpa.org/packages/async-20150909.2257.tar" "Internal server error")
  signal(file-error ("https://melpa.org/packages/async-20150909.2257.tar" "Internal server error"))
  url-insert-file-contents("https://melpa.org/packages/async-20150909.2257.tar")
  package-install-from-archive([cl-struct-package-desc async (20150909 2257) "Asynchronous processing in Emacs" ((emacs (24)) (cl-lib (0 5))) tar "melpa" nil ((:url . "https://github.com/jwiegley/emacs-async")) nil])
  mapc(package-install-from-archive ([cl-struct-package-desc async (20150909 2257) "Asynchronous processing in Emacs" ((emacs (24)) (cl-lib (0 5))) tar "melpa" nil ((:url . "https://github.com/jwiegley/emacs-async")) nil] [cl-struct-package-desc helm-core (20151024 2233) "Development files for Helm" ((emacs (24)) (cl-lib (0 5)) (async (1 5))) tar "melpa" nil ((:url . "https://emacs-helm.github.io/helm/")) nil] [cl-struct-package-desc helm (20151024 2233) "Helm is an Emacs incremental and narrowing framework" ((emacs (24)) (cl-lib (0 5)) (async (1 5)) (helm-core (1 8 0))) tar "melpa" nil ((:url . "https://emacs-helm.github.io/helm/")) nil]))
  package-download-transaction(([cl-struct-package-desc async (20150909 2257) "Asynchronous processing in Emacs" ((emacs (24)) (cl-lib (0 5))) tar "melpa" nil ((:url . "https://github.com/jwiegley/emacs-async")) nil] [cl-struct-package-desc helm-core (20151024 2233) "Development files for Helm" ((emacs (24)) (cl-lib (0 5)) (async (1 5))) tar "melpa" nil ((:url . "https://emacs-helm.github.io/helm/")) nil] [cl-struct-package-desc helm (20151024 2233) "Helm is an Emacs incremental and narrowing framework" ((emacs (24)) (cl-lib (0 5)) (async (1 5)) (helm-core (1 8 0))) tar "melpa" nil ((:url . "https://emacs-helm.github.io/helm/")) nil]))
  package-install(helm)
  (progn (package-install p))
  (if (not (package-installed-p p)) (progn (package-install p)))
  (while --dolist-tail-- (setq p (car --dolist-tail--)) (if (not (package-installed-p p)) (progn (package-install p))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- ngupta/packages) p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (if (not (package-installed-p p)) (progn (package-install p))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  eval-buffer(#<buffer  *load*> nil "/home/ngupta/.emacs.d/init.el" nil t)  ; Reading at buffer position 1037
  load-with-code-conversion("/home/ngupta/.emacs.d/init.el" "/home/ngupta/.emacs.d/init.el" t t)
  load("/home/ngupta/.emacs.d/init" t t)
  #[0 "\205\262

Here's my init.el for reference:

(require 'package)

(add-to-list 'package-archives
         '("melpa" . "https://melpa.org/packages/"))
(package-initialize)

(setq url-using-proxy t)
(setq url-proxy-services
       '(("no_proxy" . "^\\(localhost\\|10.*\\)")
         ("http" . "www-proxy.us.mycompany.com:80")
         ("https" . "www-proxy.us.mycompany.com:80")
         ("ftp" . "www-proxy.us.mycompany.com:80")))
1
Eventually I gave up on setting up proxy in emacs. Instead I now use cask which is an external python program which, among other things, downloads and manages emacs plugins. With cask I can now just set proxy environment variables and it all works perfectly. In fact cask method is better than setting in init.el since I frequently move between proxy and non-proxy environments.ngupta
Can you please explain how you used Cask? I am having the exact same issue and gave up trying with proxies and emacs. But don't know how to use cask now.SFbay007
@SFbay007 I also nearly gave up on emacs due to this proxy issue but cask saved it. With Cask I list all plugins I need in a ~/.emacs.d/Cask file and then I run 'cask install && cask upgrade' in ~/.emacs.d. Then installed plugins can be used from ~/.emacs.d/init.el. For example, you can find my emacs config on github.ngupta

1 Answers

0
votes

You can have a try with these variables

   (setq url-using-proxy t)
   (setq url-proxy-services
       '(("no_proxy" . "^\\(localhost\\|10.*\\)")
         ("http" . "proxy.address.company:port")
         ("https" . "proxy.address.company:port")
         ("ftp" . "proxy.address.company:port")))