Bug 974499

Summary: can't init mock behind a proxy
Product: [Fedora] Fedora Reporter: Yann Droneaud <yann>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: mebrown, williams, yann
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: mock-1.1.38-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-08 05:02:52 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:
Embargoed:
Attachments:
Description Flags
[PATCH] package_state: proxy configuration might be needed [BZ #974499] none

Description Yann Droneaud 2013-06-14 09:50:08 UTC
Version-Release number of selected component (if applicable):

Name        : mock
Version     : 1.1.32
Release     : 1.fc18


Description of problem:

Hi,

On my setup, with no direct connection to Internet, mock is failing to create a new build environment.

In my environment, DNS resolver is not available, direct connection is not possible: everything should goes through a HTTP proxy.

Mock was working previously in Fedora 17, but after upgrading to Fedora 18 it works no more. I wasn't able find the exact regression ...

The problem seems to happen only if the root_cache or yum_cache is obsolete and /usr/bin/repoquery need to access/rebuild some database.

The error reported is:

Start: yum update
Start: Outputting list of available packages
ERROR: Command failed. See logs for output.
 # /usr/bin/repoquery -c /var/lib/mock/fedora-17-i386-ext/root//etc/yum.conf -a --qf '%{nevra} %{buildtime} %{size} %{pkgid} %{repoid}' > /var/lib/mock//fedora-17-i386-ext/result/available_pkgs

In /var/lib/mock/fedora-17-i386-ext/result/root.log:

DEBUG util.py:314:  Executing command: /usr/bin/repoquery -c /var/lib/mock/fedora-17-i386-sdk2-test/root//etc/yum.conf -a --qf '%{nevra} %{buildtime} %{size} %{pkgid} %{repoid}' > /var/lib/mock//fedora-17-i386-sdk2-test/result/available_pkgs with env {'LANG': 'fr_FR.utf8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'HOME': '/builddir', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin'}
DEBUG util.py:264:  Cannot find a valid baseurl for repo: fedora
DEBUG util.py:354:  Child return code was: 1

The error might be unclear, but in order to get a baseurl, I tought repoquery need to contact the mirror. To do this it need to use the proxy server.
Unfortunately /var/lib/mock/fedora-17-i386-sdk2-test/root//etc/yum.conf doesn't hold any proxy configuration variable (http_proxy, https_proxy, ftp_proxy). And the environment used to run repoquery lack of the same proxy configuration variables.

The proxy configuration variables are correctly set in /etc/mock/site-default.cfg and correctly used for running others commands. And they are also defined in the user environment.

Those variables are not used when running repoquery while they are needed for it to work.

A patch to fix will follow.

Regards.

Comment 1 Yann Droneaud 2013-06-14 09:53:03 UTC
BTW, there's a workaround: 

mock --disable-plugin=package_state --init   (as seen in bug #927496)

Regards.

Comment 2 Yann Droneaud 2013-06-14 10:03:20 UTC
Created attachment 761195 [details]
[PATCH] package_state: proxy configuration might be needed [BZ #974499]

Please find a git patch to apply on top of master
https://git.fedorahosted.org/cgit/mock.git/commit/?id=d066ccf1e11cd2662ef00d845ed87035ec592791

Regards.

Comment 3 Fedora End Of Life 2013-12-21 14:00:45 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Clark Williams 2014-02-03 20:20:55 UTC
(In reply to Yann Droneaud from comment #2)
> Created attachment 761195 [details]
> [PATCH] package_state: proxy configuration might be needed [BZ #974499]
> 
> Please find a git patch to apply on top of master
> https://git.fedorahosted.org/cgit/mock.git/commit/
> ?id=d066ccf1e11cd2662ef00d845ed87035ec592791
> 
> Regards.

Applied to current tree, should be in 1.1.36 build

Comment 5 Fedora Update System 2014-02-06 02:09:14 UTC
mock-1.1.36-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc19

Comment 6 Fedora Update System 2014-02-06 02:10:54 UTC
mock-1.1.36-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.fc20

Comment 7 Fedora Update System 2014-02-06 02:12:27 UTC
mock-1.1.36-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.36-1.el6

Comment 8 Fedora Update System 2014-02-06 21:08:23 UTC
Package mock-1.1.36-1.el6:
* should fix your issue,
* was pushed to the Fedora EPEL 6 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.1.36-1.el6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2014-0467/mock-1.1.36-1.el6
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2014-02-08 05:02:52 UTC
mock-1.1.36-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2014-03-25 20:25:09 UTC
mock-1.1.37-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc19

Comment 11 Fedora Update System 2014-03-25 20:27:34 UTC
mock-1.1.37-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.fc20

Comment 12 Fedora Update System 2014-03-25 20:29:34 UTC
mock-1.1.37-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-1.el6

Comment 13 Fedora Update System 2014-03-27 17:48:09 UTC
mock-1.1.37-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc20

Comment 14 Fedora Update System 2014-03-27 17:50:03 UTC
mock-1.1.37-2.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.fc19

Comment 15 Fedora Update System 2014-03-27 17:51:55 UTC
mock-1.1.37-2.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.37-2.el6

Comment 16 Fedora Update System 2014-03-31 19:04:46 UTC
mock-1.1.38-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc19

Comment 17 Fedora Update System 2014-03-31 19:07:06 UTC
mock-1.1.38-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.el6

Comment 18 Fedora Update System 2014-03-31 19:09:04 UTC
mock-1.1.38-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.1.38-1.fc20

Comment 19 Fedora Update System 2014-04-09 13:19:06 UTC
mock-1.1.38-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2014-04-18 15:38:01 UTC
mock-1.1.38-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Fedora Update System 2014-04-19 09:20:16 UTC
mock-1.1.38-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.