We run mock builds quite successfully on Fedora CI (both Jenkins and Zuul).
Currently, the setup stopped working on rawhide, Jenkins.
See https://src.fedoraproject.org/rpms/pyproject-rpm-macros/pull-request/66
The command and error is:
+ mock -r /tmp/fedora-33-x86_64-ci.cfg --enablerepo=local init INFO: mock.py version 2.4 starting (python version = 3.9.0)... Start(bootstrap): init plugins INFO: selinux enabled Finish(bootstrap): init plugins Start: init plugins INFO: selinux enabled Finish: init plugins INFO: Signal handler active Start: run Start: clean chroot Finish: clean chroot Start(bootstrap): chroot init 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.4 INFO: Mock Version: 2.4 Finish(bootstrap): chroot init Start: chroot init INFO: calling preinit hooks INFO: enabled root cache INFO: enabled package manager cache Start: cleaning package manager metadata Finish: cleaning package manager metadata INFO: enabled HW Info plugin Mock Version: 2.4 INFO: Mock Version: 2.4 Start: dnf install ERROR: Command failed: # /usr/bin/systemd-nspawn -q -M 33f1ae0167934865bdc23d2cbe57c4dc -D /var/lib/mock/fedora-rawhide-x86_64-bootstrap/root -a --capability=cap_ipc_lock --bind=/tmp/mock-resolv.i0hpytsj:/etc/resolv.conf --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/var/lib/mock/fedora-rawhide-x86_64/root/installation-homedir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$ --setenv=LANG=C.UTF-8 --setenv=LC_MESSAGES=C.UTF-8 /usr/bin/dnf --installroot /var/lib/mock/fedora-rawhide-x86_64/root/ --releasever 33 --enablerepo local --setopt=deltarpm=False --allowerasing --disableplugin=local --disableplugin=spacewalk install @buildsys-build --setopt=tsflags=nocontexts Failed to register machine: Connection timed out
I recently hit a similar issue with mock in Jenkins on a different project. The recommendation from the mock devs was to add --no-bootstrap-chroot to the mock command for systems using mock versions >= 2.1.
I added a block to my runner script to just grep the 'mock --help' output for the --no-bootstrap-chroot option and if it is there, use it.
All supported Fedoras have mock 2.4, so --no-bootstrap-chroot should work everywhere, but I wonder why it is needed, when it wasn't needed before.
--no-bootstrap-chroot
It seems that the workaround does not work. See https://src.fedoraproject.org/rpms/pyproject-rpm-macros/pull-request/74
The error in this case is:
mock -r /tmp/fedora-33-x86_64-ci.cfg --no-bootstrap-chroot --enablerepo=local init INFO: mock.py version 2.4 starting (python version = 3.9.0)... Start: init plugins INFO: selinux enabled Finish: init plugins INFO: Signal handler active Start: run Start: clean chroot Finish: clean chroot Start: chroot init INFO: calling preinit hooks INFO: enabled root cache INFO: enabled package manager cache Start: cleaning package manager metadata Finish: cleaning package manager metadata INFO: enabled HW Info plugin Mock Version: 2.4 INFO: Mock Version: 2.4 Start: dnf install Finish: dnf install ERROR: Command failed: # /usr/bin/systemd-nspawn -q -M 9a0d729aa7484933938be79ffb94856b -D /var/lib/mock/fedora-rawhide-x86_64/root -a --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$ --setenv=LANG=C.UTF-8 /usr/sbin/groupadd -g 135 mock
This problem is gone.
Metadata Update from @churchyard: - Issue status updated to: Closed (was: Open)