You are not logged in.

#1 2016-11-11 07:07:56

doragasu
Member
Registered: 2012-03-03
Posts: 152

yaourt and pacaur not going through proxy

I'm working behind a proxy, and I configured it by setting http_proxy, https_proxy, rsync_proxy and ftp_proxy environment variables. Almost everything works (pacman, web browsers, git+https, wget, curl...) but I cannot get yaourt and pacaur to work:

jalon ~ $ yaourt -Ss vim-youcompleteme-git
curl error: Failure when receiving data from the peer
jalon ~ $ pacaur -Ss vim-youcompleteme-git
error: [vim-youcompleteme-git]: Failure when receiving data from the peer
jalon ~ $ yaourt -Ss kicad
community/kicad 4.0.4-2
    Electronic schematic and printed circuit board (PCB) design tools
community/kicad-library 4.0.4-1
    Kicad component and footprint libraries
community/kicad-library-3d 4.0.4-1
    Kicad 3D render model libraries
curl error: Failure when receiving data from the peer
jalon ~ $ pacaur -Ss kicad
community/kicad 4.0.4-2
    Electronic schematic and printed circuit board (PCB) design tools
community/kicad-library 4.0.4-1
    Kicad component and footprint libraries
community/kicad-library-3d 4.0.4-1
    Kicad 3D render model libraries
error: [kicad]: Failure when receiving data from the peer
jalon ~ $ 

When I search for a package, it looks like results obtained from pacman database are properly displayed, but AUR search fails. I don't know how pacaur works under the hood, but it looks like yaourt uses curl, what make the problem a bit strange, because as I stated before, curl is working perfect on my system. I can also access AUR on the web browser, to confirm it's not blocked by the proxy.

How can I know if the problem is because of yaourt/pacaur not honoring proxy settings, or because somehow the proxy is blocking requests?

Offline

#2 2016-11-11 09:20:41

Spyhawk
Member
Registered: 2006-07-07
Posts: 485

Re: yaourt and pacaur not going through proxy

Pacaur indeed uses curl to access the AUR RPC interface. The search feature is entirely provided by cower, so you might also want to check that it works correctly (it also uses curl).

Offline

#3 2016-11-14 13:21:00

doragasu
Member
Registered: 2012-03-03
Posts: 152

Re: yaourt and pacaur not going through proxy

It looks like cower is not working, even though curl properly gets the HTTP response to the query when called from the command line:
Maybe cower "eats" proxy settings?

jalon ~ $ cower --debug -v -s vim-youcompleteme-git
debug: adding target: vim-youcompleteme-git
debug: initializing alpm
debug: registering alpm db: core
debug: registering alpm db: extra
debug: registering alpm db: community
debug: searching with fragment 'vim-youcompleteme-git' from 'vim-youcompleteme-git'
debug: [vim-youcompleteme-git]: curl_easy_perform https://aur.archlinux.org/rpc.php?v=5&type=search&arg=vim-youcompleteme-git&by=name-desc
error: [vim-youcompleteme-git]: Failure when receiving data from the peer
debug: releasing curl
debug: releasing alpm
jalon ~ $ curl "https://aur.archlinux.org/rpc.php?v=5&type=search&arg=vim-youcompleteme-git&by=name-desc"
{"version":5,"type":"search","resultcount":1,"results":[{"ID":341349,"Name":"vim-youcompleteme-git","PackageBaseID":66973,"PackageBase":"vim-youcompleteme-git","Version":"28.972eecb-1","Description":"A code-completion engine for Vim","URL":"http:\/\/valloric.github.com\/YouCompleteMe\/","NumVotes":112,"Popularity":4.229034,"OutOfDate":null,"Maintainer":"tata","FirstSubmitted":1360099972,"LastModified":1474727083,"URLPath":"\/cgit\/aur.git\/snapshot\/vim-youcompleteme-git.tar.gz"}]}

Could it be cower "eating" proxy settings?

Offline

#4 2016-11-14 15:49:49

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: yaourt and pacaur not going through proxy

Is it behind your own local proxy or a vpn proxy (such as tor)?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2016-11-15 08:03:08

doragasu
Member
Registered: 2012-03-03
Posts: 152

Re: yaourt and pacaur not going through proxy

It's behind a corporate proxy.

Offline

#6 2016-11-30 21:58:55

foreverdante
Member
Registered: 2016-11-23
Posts: 25

Re: yaourt and pacaur not going through proxy

Bump

Offline

#7 2016-12-01 06:37:41

doragasu
Member
Registered: 2012-03-03
Posts: 152

Re: yaourt and pacaur not going through proxy

I have stopped investigating this issue, but it's likely related to this other problem I also had with pacman. I solved it by configuring pacman to use an external program (curl/wget) to download packages. I don't know if something similar can be done with yaourt, a quick look to the config file does not show any options to specify an external downloader.

Offline

#8 2016-12-01 10:40:27

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: yaourt and pacaur not going through proxy

Which is okay, since they are both shell scripts invoking curl anyway. So as long as curl natively works, there should be no problems. If curl doesn't natively work, then as long as you can pass options to curl to get it to work, you can also put those options in ~/.curlrc so you can fix "it" for more than just AUR helpers (and pacman, if you use it as an external downloader). wink

Last edited by eschwartz (2016-12-01 10:44:24)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#9 2016-12-01 14:11:20

doragasu
Member
Registered: 2012-03-03
Posts: 152

Re: yaourt and pacaur not going through proxy

I don't know if I understood your suggestion. The problem I had is that pacman (and maybe also yaourt) set a custom User-Agent. So curl works with default User-Agent string, but fails when using other strings. I'm not sure if options set in .curlrc can override the ones directly set by pacman/yaourt. I might give it a try, but I have not high hopes in it.

Offline

#10 2016-12-01 18:05:55

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: yaourt and pacaur not going through proxy

Actually, forget what I said before. package-query (which yaourt uses for everything except actual tarball downloads, in which case it uses /usr/bin/curl directly) sets a user-agent of "package-query/$version". cower (which pacaur uses for everything but scraping the RPC json interface) may do similar.
I am pretty sure ~/.curlrc doesn't affect libcurl, just /usr/bin/curl. wink

The problem is deeper than yaourt or pacaur though.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#11 2016-12-02 15:42:20

ezacaria
Member
Registered: 2007-12-10
Posts: 113

Re: yaourt and pacaur not going through proxy

Do you still have the problem? I installed pacaur today in a virtual machine behind a proxy, and setting the environment as in the "Proxy settings" wiki solved the problem (i.e., declaring only http_proxy and the rest based on $http_proxy). I could use pacaur afterwards.

Offline

#12 2016-12-07 08:06:44

doragasu
Member
Registered: 2012-03-03
Posts: 152

Re: yaourt and pacaur not going through proxy

ezacaria wrote:

Do you still have the problem? I installed pacaur today in a virtual machine behind a proxy, and setting the environment as in the "Proxy settings" wiki solved the problem (i.e., declaring only http_proxy and the rest based on $http_proxy). I could use pacaur afterwards.

Unfortunately I still have the problem. It looks like my proxy is blocking HTTP requests having "strange" user-agents. Maybe your proxy is less strict. I have fired Wireshark to peek what exactly is yaourt doing, and as I suspected, user-agent is not set to curl or any other "well known" user-agent:

CONNECT aur.archlinux.org:443 HTTP/1.1
Host: aur.archlinux.org:443
User-Agent: package-query/1.8
Proxy-Connection: Keep-Alive

I need to spoof the User-Agent to be something like "curl", or I will not be able to traverse my proxy.

Last edited by doragasu (2016-12-07 08:07:57)

Offline

Board footer

Powered by FluxBB