Jguer / yay

Yet another Yogurt - An AUR Helper written in Go
GNU General Public License v3.0
11.15k stars 363 forks source link

yay -Syua: proxyconnect tcp: dial tcp: lookup $http_proxy: no such host #925

Closed jecogeo closed 5 years ago

jecogeo commented 5 years ago

Affected Version

yay v9.1.0 - libalpm v11.0.3

Issue

yay doesn't work under proxy servers and even removing the proxy from environment variables, it doesn't work as well. The /etc/sudoers file already has the line Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy".

Steps to reproduce

  1. echo $http_proxy example output: 123.456.789.098

  2. export http_proxy=""

  3. echo $http_proxy the output is a blank line.

  4. yay -Syua

Output

:: Searching AUR for updates...
Get https://aur.archlinux.org/rpc.php?arg%5B%5D=auracle-git&arg%5B%5D=brave-bin&arg%5B%5D=cryptomator&arg%5B%5D=dropbox&arg%5B%5D=gamin&arg%5B%5D=gdm3setup&arg%5B%5D=gdm3setup-utils&arg%5B%5D=gnome-terminal-transparency&arg%5B%5D=mendeleydesktop&arg%5B%5D=pacaur&arg%5B%5D=pamac-aur&arg%5B%5D=pamac-tray-appindicator&arg%5B%5D=python-psycopg2-binary&arg%5B%5D=rstudio-desktop-bin&arg%5B%5D=timeshift&arg%5B%5D=wps-office&arg%5B%5D=yay&type=info&v=5: proxyconnect tcp: dial tcp: lookup $http_proxy: no such host
Jguer commented 5 years ago

I use yay behind a proxy without any issue. Are you using yay compiled with go or gcc-go? Also, if it helps, my working proxy is of the type: http_proxy= http://123.456.789.098:465/ with protocol and port specified.

Behind a proxy server it's normal that yay doesn't work without going through it (if the network is properly setup) so I don't understand what you mean with removing the proxy :confused:

For proxy, yay doesn't change anything except using Go's http library (https://golang.org/pkg/net/http/#ProxyFromEnvironment) so this problem would apply to all your go programs

jecogeo commented 5 years ago

While writing a reply, I've identified that HTTPS_PROXY (upper case) environment variable is set as /. Not sure why. Even if http_proxy (lower case) is right, the upper case variable was causing the issue. Correting this and everything is working good. Thanks and sorry for opening this unnecessary issue.

Regards