Description of problem: In fact I do not know how to set it. Version-Release number of selected component (if applicable): mock-1.1.18-1.fc16.noarch How reproducible: Always. Steps to Reproduce: mock -r fedora-16-x86_64 --init Actual results: Downloads happen directly from Internet. Expected results: Downloads happen via http://127.0.0.1:3128 Additional info: http://fedoraproject.org/wiki/Extras/MockTricks#Using_Squid_to_Speed_Up_Mock_package_downloads seems wrong to me wrt echo export http_proxy=\"http://localhost:3128\" >> /home/build/.bash_profile as there is no "build" user and it does not work for "root" user during --init. export http_proxy=http://localhost:3128; mock ... does not work as mock is `consolehelper' and it immediately clears whole environment. Maybe one could set up /etc/pam.d/mock using pam_env.so somehow. Putting to /etc/mock/site-defaults.cfg config_opts['yum.conf'] = """ [main] proxy=http://127.0.0.1:3128/ """ also does not work, assuming config_opts['yum.conf'] gets overwritten by /etc/mock/specificconfig.cfg.
Jan, You're going to have to help me a bit with some Proxy 101. I understand that what we're trying to do here is redirect HTTP requests from going straight to a network interface/address/port tuple to go to specified localhost port, presumably where a proxy (squid) is listening. That's about the extent of my proxy experience. Guessing that "build" from the receipe above, should actually be <your login> so that what you're doing is setting the environment variable http_proxy in the account that is also a member of the mock group. If the environment variable 'http-proxy' is the redirection mechanism, I'll bet it's been broken for a while. Consolehelper and the environment variable cleanup probably killed it. So, let me poke a bit at the configuration code. I believe what we need is: 1. make sure that http_proxy gets into the environment after the consolehelper startup (take the value from the config file) and/or 2. ensure we configure the yum config file properly.
Created attachment 545339 [details] simple patch to propagate proxy environment variable setting Jan, Please try adding this patch (since you already have a squid setup). If you can't I'll try it tomorrow.
Thanks, just I do not see a change with this patch. Tried in /etc/mock/site-defaults.cfg both: config_opts['environment']['http_proxy'] = 'http://127.0.0.1:3128/' and config_opts['http_proxy'] = 'http://127.0.0.1:3128/' and it always ends up: A \_ mock -r fedora-16-x86_64 --init B \_ /usr/bin/python -tt /usr/sbin/mock -r fedora-16-x86_64 --init C \_ /usr/bin/python /usr/bin/yum --installroot /var/lib/mock/fedora-16-x86_64/root/ groupinstall buildsys-build B: DISPLAY=:0.0 LANG=en_US.UTF-8 SHELL=/bin/bash TERM=xterm PATH=/usr/sbin:/usr/bin:/sbin:/bin:/root/bin LOGNAME=root USER=root USERHELPER_UID=0 HOME=/root C: LANG=en_US.UTF-8 TERM=vt100 SHELL=/bin/bash HOSTNAME=mock HOME=/builddir PATH=/usr/bin:/bin:/usr/sbin:/sbin TMPDIR=/tmp with no http_proxy anywhere (and still downloading without any proxy). (In reply to comment #2) > (since you already have a squid setup). IMO if it just starts erroring out on ECONNREFUSED it is a win for you.
Created attachment 550269 [details] Patch to setup http_proxy environment variable in chroot via config I believe this patch sets up http_proxy properly. Uncomment the variable definition in site-defaults.cfg and it should setup http_proxy in the chroot (at least when I did it with --shell it was there and yum failed miserably when running in the chroot :).
(In reply to comment #4) > I believe this patch sets up http_proxy properly. It does not for me. It is the same patch as in Comment 2 and it does not work the same way I described in Comment 3: I did: patch /usr/lib/python2.7/site-packages/mockbuild/backend.py </tmp/1 and put config_opts['http_proxy'] = 'http://localhost:3128' to /etc/mock/site-defaults.cfg and ran mock -r fedora-16-x86_64 --init and got in netstat -p: tcp 0 0 host2.jan:47634 odysseus.ip6.fi.muni.c:http ESTABLISHED 24068/python tcp 0 0 host2.jan:44958 2610:28:3090:3001:dead:http ESTABLISHED 24068/python while 24068 was: 24053 \_ mock -r fedora-16-x86_64 --init 24054 \_ /usr/bin/python -tt /usr/sbin/mock -r fedora-16-x86_64 --init 24068 \_ /usr/bin/python /usr/bin/yum --installroot /var/lib/mock/fedora-16-x86_64/root/ groupinstall buildsys-build and /var/log/squid/access.log also remained completely empty. > it should setup http_proxy in the chroot (at least when I did it with --shell > it was there and yum failed miserably when running in the chroot :). It may have effect for --shell but that is a second step. I can easily workaround that part (in fact my .bashrc already probably workarounds that). Proxy support for mock should IMO primarily mean to support proxy for mock --init and mock --update. Sure still thanks for the patch.
Created attachment 550762 [details] call chroot.doChroot to pass configured environment to chroot when running a rebuild Argghh, I forgot this patch, which actually passes the appropriate environment to the chroot when running a rebuild.
I have used the Comment 6 patch for /usr/sbin/mock , together with the state of Comment 5, and I still see no proxy used on --init. Does it work for you?
mock-1.1.19-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.19-1.el6
mock-1.1.19-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.19-1.fc16
mock-1.0.26-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.26-1.el5
mock-1.1.19-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.19-1.fc15
Why is this Bug MODIFIED and included in Bodhi when it still does not work? This is not true: * add code to allow global proxy in chroot [BZ# 766199]
mock-1.1.19-2.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.19-2.fc15
mock-1.1.19-2.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.19-2.el6
mock-1.0.26-2.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.26-2.el5
mock-1.1.19-2.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.19-2.fc16
Package mock-1.1.19-2.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.19-2.el6' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-0134/mock-1.1.19-2.el6 then log in and leave karma (feedback).
It works now, for --init, --update and even yum inside --shell. It ignores $http_proxy but it follows config_opts['http_proxy'] in /etc/mock/site-defaults.cfg . Thanks!
Package mock-1.1.19-2.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing mock-1.1.19-2.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-0536/mock-1.1.19-2.fc15 then log in and leave karma (feedback).
mock-1.1.19-2.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.20-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.20-1.fc15
mock-1.1.20-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.20-1.el6
mock-1.1.20-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.20-1.fc16
mock-1.0.27-2.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.27-2.el5
mock-1.1.20-1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.21-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/mock-1.1.21-1.fc15
mock-1.1.21-1.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/mock-1.1.21-1.el6
mock-1.0.28-1.el5 has been submitted as an update for Fedora EPEL 5. https://admin.fedoraproject.org/updates/mock-1.0.28-1.el5
mock-1.1.21-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/mock-1.1.21-1.fc16
mock-1.1.21-1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.21-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.
mock-1.1.21-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.
mock-1.0.28-1.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.