Description of problem: Using it under CentOS7 it will fail. Doing the same on Fedora 33 will work. Version-Release number of selected component (if applicable): mock-2.14-1.el7.noarch How reproducible: Every time Steps to Reproduce: 1. call "mock -r centos-stream-8-x86_64 --init" Actual results: INFO: mock.py version 2.14 starting (python version = 3.6.8, NVR = mock-2.14-1.el7)... INFO: Using 'yum' instead of 'dnf' for bootstrap chroot Start(bootstrap): init plugins INFO: tmpfs initialized INFO: selinux enabled Finish(bootstrap): init plugins Start: init plugins INFO: tmpfs initialized INFO: selinux enabled Finish: init plugins INFO: Signal handler active Start: run Start: clean chroot Finish: clean chroot Start(bootstrap): chroot init INFO: mounting tmpfs at /var/lib/mock/centos-stream-8-x86_64-bootstrap/root. INFO: calling preinit hooks INFO: enabled root cache INFO: enabled package manager cache Start(bootstrap): cleaning package manager metadata Finish(bootstrap): cleaning package manager metadata INFO: enabled HW Info plugin Mock Version: 2.14 INFO: Mock Version: 2.14 Start(bootstrap): yum install INFO: unmounting tmpfs. ERROR: Command failed: # /usr/bin/yum --installroot /var/lib/mock/centos-stream-8-x86_64-bootstrap/root/ --releasever 8 install dnf dnf-plugins-core --setopt=tsflags=nocontexts Failed to set locale, defaulting to C One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true Cannot find a valid baseurl for repo: appstream/x86_64 Expected results: That it will work like on Fedora 33 Additional info:
I can reproduce.
Hmm, when I replace mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra in config with mirrorlist=http://mirrorlist.centos.org/?release=8&arch=$basearch&repo=BaseOS&infra=$infra i.e. expand the $stream variable, it starts working.
Centos Stream 9 does not have this problem as it does not use $stream When I replace $stream with $releasever, it will work. Will do a PR.
The culprit is in config_opts['dnf_vars'] = { 'stream': '8-stream', 'contentdir': 'centos', } This creates dnf variables, but not yum variables.
> /usr/bin/yum --installroot /var/lib/mock/centos-stream-8-x86_64-bootstrap/root/ --releasever 8 install dnf dnf-plugins-core --setopt=tsflags=nocontexts Why /usr/bin/yum?
Ah, we are on EL7.
https://github.com/rpm-software-management/mock/pull/809
FEDORA-EPEL-2021-82ccb8f2b7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-82ccb8f2b7
FEDORA-2021-0947974f0a has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-0947974f0a
FEDORA-2021-a7d4aaa6fe has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-a7d4aaa6fe
FEDORA-2021-0947974f0a has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-0947974f0a` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-0947974f0a See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2021-2d0f959e00 has been pushed to the Fedora EPEL 8 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-2d0f959e00 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2021-82ccb8f2b7 has been pushed to the Fedora EPEL 7 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-82ccb8f2b7 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-a7d4aaa6fe has been pushed to the Fedora 35 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-a7d4aaa6fe` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-a7d4aaa6fe See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
(In reply to Miroslav Suchý from comment #7) > https://github.com/rpm-software-management/mock/pull/809 This doesn't fix the real issue; mock should be configuring extended variables for yum just like it does for dnf. It is actually straightforward: https://github.com/rpm-software-management/mock/pull/847
Thanks for the update, but the request for using YUM variables is an orthogonal thing. This bug is about real life build failures, and the updated mock + mock-core-configs (currently stuck in Bodhi) fixes this.
*** Bug 2035507 has been marked as a duplicate of this bug. ***
For me mock-2.16-1.el7 and mock-core-configs-36.4-1.el7 , will work again on CentOS7.
FEDORA-2021-a7d4aaa6fe has been pushed to the Fedora 35 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-0947974f0a has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2021-82ccb8f2b7 has been pushed to the Fedora EPEL 7 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2021-2d0f959e00 has been pushed to the Fedora EPEL 8 stable repository. If problem still persists, please make note of it in this bug report.