Bug 1325519

Summary: Dnf does not inherit environment variables for proxy server http_proxy, ftp_proxy etc.
Product: [Fedora] Fedora Reporter: srakitnican <samuel.rakitnican>
Component: dnfAssignee: rpm-software-management
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: jmracek, jpfirr, jsilhan, mluscon, packaging-team-maint, pnemade, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-21 14:26:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description srakitnican 2016-04-09 14:30:58 UTC
Description of problem: Dnf does not inherit environment variables for proxy server http_proxy, ftp_proxy etc.


Version-Release number of selected component (if applicable):
dnf-1.1.8-1.fc24

How reproducible: Always


Steps to Reproduce:
1. Set environment variable for proxy like # echo "export http_proxy=http://server:port" > /etc/profile.d/proxy.sh
2. Try to use dnf, and watch proxy server access log


Actual results: dnf does not use proxy server from http_proxy


Expected results: dnf inherits system variable


Additional info: command line programs (wget, curl) uses variable

Comment 1 Juan Pablo Firrincieli 2016-05-20 16:15:26 UTC
I confirm this bug, dns doesn't use proxy server even if its stated in /etc/dnf.conf

Comment 2 Juan Pablo Firrincieli 2016-05-20 16:20:56 UTC
[root@localhost ~]# export http_proxy="http://user:pass@proxyhost:port"
[root@localhost ~]# export https_proxy="http://user:pass@proxyhost:port"
[root@localhost ~]# export ftp_proxy="http://user:pass@proxyhost:port"
[root@localhost ~]# dnf list
Error: Failed to synchronize cache for repo 'fedora'
[root@localhost ~]# dnf -v list
cachedir: /var/cache/dnf
Loaded plugins: playground, reposync, builddep, needs-restarting, noroot, langpacks, copr, config-manager, download, Query, debuginfo-install, generate_completion_cache, protected_packages
langpacks: No languages are enabled
Error reading file : /var/lib/dnf/plugins/langpacks/installed_langpacks as it does not exist
initialized Langpacks plugin
DNF version: 1.1.8
Cannot download 'https://mirrors.fedoraproject.org/metalink?repo=updates-released-f24&arch=x86_64': Cannot prepare internal mirrorlist: Curl error (56): Failure when receiving data from the peer for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f24&arch=x86_64 [Invalid file descriptor].
Error: Failed to synchronize cache for repo 'updates'
[root@localhost ~]# curl "https://mirrors.fedoraproject.org/metalink?repo=updates-released-f24&arch=x86_64"
<?xml version="1.0" encoding="utf-8"?>
<metalink version="3.0" xmlns="http://www.metalinker.org/" type="dynamic" pubdate="Fri, 20 May 2016 16:19:29 GMT" generator="mirrormanager" xmlns:mm0="http://fedorahosted.org/mirrormanager">
  <files>
    <file name="repomd.xml">
      <mm0:timestamp>1437058214</mm0:timestamp>
      <size>2970</size>
      <verification>
        <hash type="md5">9cee117ca21fdc68ec4d42525301cc16</hash>
        <hash type="sha1">8e8b2f316b7f0d9aa8e696bdb361055abdf5c025</hash>
        <hash type="sha256">0b96cd461103ed61d57f4aff62c4cb72736a752ec3f8ea1acef39503fbce86d4</hash>
        <hash type="sha512">d016b517c82db9cc987b58e231581bb2a2d5d6c6a58874d4c8789e9fcf60a8dc1072df73cdd565fb9e376f711a978d559b2246d664aea47b9482d85af9b1b380</hash>
      </verification>
      <resources maxconnections="1">
        <url protocol="rsync" type="rsync" location="BR" preference="100" >rsync://fedora.c3sl.ufpr.br/fedora/linux/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="http" type="http" location="BR" preference="100" >http://fedora.c3sl.ufpr.br/linux/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="http" type="http" location="BR" preference="99" >http://mirror.globo.com/fedora/linux/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="ftp" type="ftp" location="EC" preference="98" >ftp://mirror.cedia.org.ec/fedora/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="rsync" type="rsync" location="EC" preference="98" >rsync://mirror.cedia.org.ec/fedora/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="http" type="http" location="EC" preference="98" >http://mirror.cedia.org.ec/fedora/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="ftp" type="ftp" location="CL" preference="97" >ftp://fedora.gtdinternet.com/pub/Linux/Fedora/linux/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="http" type="http" location="CL" preference="97" >http://fedora.gtdinternet.com/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="rsync" type="rsync" location="EC" preference="96" >rsync://mirror.uta.edu.ec/fedora/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="ftp" type="ftp" location="EC" preference="96" >ftp://mirror.uta.edu.ec/fedora/updates/24/x86_64/repodata/repomd.xml</url>
        <url protocol="http" type="http" location="EC" preference="96" >http://mirror.uta.edu.ec/fedora/updates/24/x86_64/repodata/repomd.xml</url>
      </resources>
    </file>
  </files>
</metalink>

Comment 3 srakitnican 2016-06-13 21:07:03 UTC
(In reply to Juan Pablo Firrincieli from comment #1)
> I confirm this bug, dns doesn't use proxy server even if its stated in
> /etc/dnf.conf

Not sure if your path is wrong or you made a typo. Dnf keeps its configuration file under /etc/dnf/dnf.conf.

For me it works if I specify a line in /etc/dnf/dnf.conf like:
proxy=http://proxyserver:3128

Comment 4 Fedora Admin XMLRPC Client 2016-07-08 09:32:42 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.