Bug 11265 - urpmi doesn't work with aria2 & proxy without user
Summary: urpmi doesn't work with aria2 & proxy without user
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 5
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard: MGA3TOO MGA4TOO
Keywords: PATCH, Triaged
Depends on:
Blocks:
 
Reported: 2013-09-21 17:40 CEST by Javier Díaz
Modified: 2015-08-27 18:07 CEST (History)
2 users (show)

See Also:
Source RPM: urpmi-8.06-1.mga5
CVE:
Status comment:


Attachments

Description Javier Díaz 2013-09-21 17:40:10 CEST
Description of problem:

 urpmi doesn't work with aria2 & proxy without user

How reproducible:

 If urpmi is configured with aria2 & proxy without user, it doesn't work.

Configuration example:

# cat /etc/urpmi/proxy.cfg 
http_proxy=127.0.0.1:5865
ftp_proxy=127.0.0.1:5865

# grep aria2 /etc/urpmi/urpmi.cfg 
  downloader: aria2

Error that appears:

#urpmi -auto-update
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--all-proxy'.
  -> [OptionHandlerImpl.cc:551] errorCode=1 unrecognized proxy format
Usage:
 --all-proxy=PROXY            Use this proxy server for all protocols. To erase
                              previously defined proxy, use "".
                              You can override this setting and specify a
                              proxy server for a particular protocol using
                              --http-proxy, --https-proxy and --ftp-proxy
                              options.
                              This affects all URLs.

                              Possible Values: [http://][USER:PASSWORD@]HOST[:PORT]
                              Tags: #http, #https, #ftp
...retrieving failed: aria2 failed: exited with 28


The problem is that an extra @ is printed when invoking aria2. To correct it, the following change must be done in /usr/lib/perl5/vendor_perl/5.16.3/urpm/download.pm:

# diff /usr/lib/perl5/vendor_perl/5.16.3/urpm/download.pm.old /usr/lib/perl5/vendor_perl/5.16.3/urpm/download.pm
281c281
<           $allproxy .= "@";
---
>           $allproxy .= "@" if $p->{user};

With this change, @ is only printed when user is defined

Reproducible: 

Steps to Reproduce:
Manuel Hiebel 2013-09-24 17:51:15 CEST

Keywords: (none) => Triaged
Assignee: bugsquad => thierry.vignaud

Comment 1 Ernest CHIARELLO 2014-09-02 14:31:54 CEST
Same problem today, 2 september 2014 : an extra @ is printed when invoking aria2 when the proxy does not need a user.

[root@zzz ~]# urpmi.addmedia --distrib --mirrorlist 'http://mirrors.mageia.org/api/mageia.4.x86_64.list' --debug
getting exclusive lock on urpmi
parsing: /etc/urpmi/mediacfg.d/Official-4-x86_64
parsing: /etc/urpmi/mediacfg.d/Official-4.1-x86_64
loading mirrors cache
using mirror ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/4/x86_64
récupération du fichier media.cfg...
récupération de http://mirrors.mageia.org/api/mageia.4.x86_64.list  media/media_info/media.cfg
'/usr/bin/aria2c' '--log' '/var/cache/urpmi/partial/.aria2.log' '--auto-file-renaming=false' '--ftp-pasv' '--summary-interval=0' '--follow-metalink=mem' '--metalink-enable-unique-protocol=true' '--metalink-preferred-protocol=http' '--max-tries=5' '--lowest-speed-limit=20K' '--timeout' '3' '--split=3' '--uri-selector=adaptive' '--server-stat-if=/root/.aria2-adaptive-stats' '--server-stat-of=/root/.aria2-adaptive-stats' '--max-file-not-found=9' '--connect-timeout=6' '-Z' '-j1' '--allow-overwrite=true' '--all-proxy=http://@proxy-web.univ-fcomte.fr:3128' '/var/cache/urpmi/.metalink'
Exception: [AbstractOptionHandler.cc:69] errorCode=28 We encountered a problem while processing the option '--all-proxy'.
  -> [OptionHandlerImpl.cc:508] errorCode=1 unrecognized proxy format
Usage:
 --all-proxy=PROXY            Use this proxy server for all protocols. To erase
                              previously defined proxy, use "".
                              You can override this setting and specify a
                              proxy server for a particular protocol using
                              --http-proxy, --https-proxy and --ftp-proxy
                              options.
                              This affects all URLs.

                              Possible Values: [http://][USER:PASSWORD@]HOST[:PORT]
                              Tags: #http, #https, #ftp
error: aria2 a échoué : sortie avec 28

... échec de la récupération : aria2 a échoué : sortie avec 28

we have :
'--all-proxy=http://@proxy-web.univ-fcomte.fr:3128'
instead of :
'--all-proxy=http://proxy-web.univ-fcomte.fr:3128'

Mageia 4, Per 5.18 :
/usr/lib/perl5/vendor_perl/5.18.1/urpm/download.pm

i used the solution proposed by Javier Diaz.

<           $allproxy .= "@";

should be :

>           $allproxy .= "@" if $p->{user};


Thanks in advance to take into account this correction for Mageia 5 ! ;)


Ernest.

CC: (none) => ernest.chiarello

Comment 2 Manuel Hiebel 2014-09-03 21:19:36 CEST
so the patch works ?

Version: 3 => 4
Whiteboard: (none) => MGA3TOO

Comment 3 Javier Díaz 2015-08-21 10:27:29 CEST
Hello, I'm upgrading to MGA5 and this is still failing, when urpmi rpm was upgraded, my fix was lost and the error appeared again.

¿Is it possible to include the fix in urpmi package?

Thanks!

Version: 4 => 5
Source RPM: urpmi-7.27.3-2.mga3 => urpmi-8.06-1.mga5
Severity: normal => major

Javier Díaz 2015-08-21 10:28:54 CEST

Whiteboard: MGA3TOO => MGA3TOO MGA4TOO

Comment 4 Sander Lepik 2015-08-21 20:08:34 CEST
Thierry, why are you ignoring this bug? :)

CC: (none) => mageia

Thierry Vignaud 2015-08-25 09:57:30 CEST

Keywords: (none) => PATCH
Status: NEW => ASSIGNED

Comment 5 Mageia Robot 2015-08-26 22:30:18 CEST
commit 8528697f7a1209761058dcb15897dab8bc87b158
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Wed Aug 26 22:26:49 2015 +0200

    fix using a proxy without an auth user (mga#11265)
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/urpmi/commit/?id=8528697f7a1209761058dcb15897dab8bc87b158
Comment 6 Thierry Vignaud 2015-08-26 22:30:40 CEST
Fixed in git

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED

Comment 7 Mageia Robot 2015-08-27 18:07:23 CEST
commit 8a252bf031a37e0151a1ead1dd0adf5ce6f2acaf
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Wed Aug 26 22:26:49 2015 +0200

    fix using a proxy without an auth user (mga#11265)
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/urpmi/commit/?id=8a252bf031a37e0151a1ead1dd0adf5ce6f2acaf

Note You need to log in before you can comment on or make changes to this bug.