I'm trying to resolve an issue where my livemedia jobs in koji are
failing. It is quite clear from the anaconda-packaging.log that repo
metadata cannot be obtained:
12:05:18,746 INFO packaging: Error downloading '.treeinfo':
HTTPConnectionPool(host='mdct-aos-master.dartcontainer.com', port=80):
Max retries exceeded with url:
/pub/fedora/25/Everything/x86_64/os//.treeinfo (Caused by
NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection
object at 0x7f9948747da0>: Failed to establish a new connection: [Errno
-2] Name or service not known',))
I'm using the old-style chroot (via mock.new_chroot=False on my koji
build tag), so I try the following as an experiment to learn first hand
what's going on:
$ sudo mock --old-chroot -r /etc/mock/koji/f25-build-6577-9475.cfg shell
INFO: mock.py version 1.4.11 starting (python version = 3.6.5)...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
Start: chroot init
INFO: calling preinit hooks
INFO: enabled HW Info plugin
Finish: chroot init
Start: shell
<mock-chroot> sh-4.3# curl
https://mdct-aos-master.dartcontainer.com/pub/fedora/25/Everything/x86_64...
... and for whatever reason, this works -- curl can resolve the hostname
and fetch the treeinfo. But why is this behaving differently than when
the livemedia task needs to do effectively the same?
This is with mock-1.4.11-1.fc28.noarch and
koji-builder-1.15.1-1.fc28.noarch. kojid logged the following when it
ran the mock task:
2018-07-17 11:27:39,788 [INFO] koji.build.buildroot: /usr/bin/mock -r
koji/f25-build-6576-9475 --old-chroot --cwd /chroot_tmpdir --chroot --
/sbin/livemedia-creator --ks
/chroot_tmpdir/koji-image-f25-build-50727.ks --logfile
/chroot_tmpdir/lmc-logs/livemedia-out.log --no-virt --resultdir
/chroot_tmpdir/lmc --project mdct-aos-flash --make-iso --volid
mdct-aos-flash-algedi-1 --iso-only --iso-name
mdct-aos-flash-x86_64-algedi-1.iso --releasever algedi --title
mdct-aos-flash --macboot --lorax-templates
/chroot_tmpdir/mdct-aos-flash/genesis/templates.d
The mock config looks like this:
$ cat /etc/mock/koji/f25-build-6577-9475.cfg
# Auto-generated by the Koji build system
# Koji buildroot id: 6577
# Koji buildroot name: f25-build-6577-9475
# Koji repo id: 9475
# Koji tag: f25-build
config_opts['chroothome'] = '/builddir'
config_opts['use_host_resolv'] = True
config_opts['basedir'] = '/var/lib/mock'
config_opts['rpmbuild_timeout'] = 86400
config_opts['yum.conf'] =
'[main]\ncachedir=/var/cache/yum\ndebuglevel=1\nlogfile=/var/log/yum.log\nreposdir=/dev/null\nretries=20\nobsoletes=1\ngpgcheck=0\nassumeyes=1\nkeepcache=1\ninstall_weak_deps=0\nstrict=1\n\n#
repos\n\n[build]\nname=build\nbaseurl=http://mdct-koji-c7.dartcontainer.c...
config_opts['chroot_setup_cmd'] = 'groupinstall livemedia-build'
config_opts['target_arch'] = 'x86_64'
config_opts['root'] = 'f25-build-6577-9475'
config_opts['plugin_conf']['root_cache_enable'] = False
config_opts['plugin_conf']['yum_cache_enable'] = False
config_opts['plugin_conf']['ccache_enable'] = False
config_opts['macros']['%_host'] = 'x86_64-koji-linux-gnu'
config_opts['macros']['%_host_cpu'] = 'x86_64'
config_opts['macros']['%vendor'] = 'Koji'
config_opts['macros']['%distribution'] = 'Koji'
config_opts['macros']['%_topdir'] = '/builddir/build'
config_opts['macros']['%_rpmfilename'] =
'%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'
config_opts['macros']['%packager'] = 'Koji'
config_opts['files']['etc/hosts'] =
'127.0.0.1\tlocalhost\tlocalhost.localdomain localhost4
localhost4.localdomain4\n::1\tlocalhost\tlocalhost.localdomain
localhost6 localhost6.localdomain6\n10.201.64.28
mdct-aos-master-f26.dartcontainer.com\n'
I did find it necessary to modify the builder's /etc/hosts file to add
the host record so that name resolution was possible for the mock shell
test, but this doesn't seem to help the liveimage task.