Bug in yum-minimal element when building centos 8 image

Bug #1911821 reported by Tim Randles
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
diskimage-builder
New
Undecided
Unassigned

Bug Description

08-yum-chroot in the yum-minimal element has a bug. When trying to build a centos-minimal image, DIB_RELEASE=8, the following happens:

2021-01-14 22:27:01.871 | dib-run-parts Running /tmp/dib_build.vkYhmyf6/hooks/root.d/08-yum-chroot
2021-01-14 22:27:02.409 | Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
2021-01-14 22:27:02.409 | DNF version: 4.2.17
2021-01-14 22:27:02.409 | cachedir: /tmp/tmp.ehOGDH0ORq
2021-01-14 22:27:02.416 | User-Agent: constructed: 'libdnf (CentOS Linux 8; generic; Linux.x86_64)'
2021-01-14 22:27:02.776 | repo: downloading from remote: centos-appstream
2021-01-14 22:27:06.177 | CentOS-8 - AppStream 1.9 MB/s | 6.3 MB 00:03
2021-01-14 22:27:07.646 | centos-appstream: using metadata from Thu Jan 7 08:51:09 2021.
2021-01-14 22:27:07.646 | repo: downloading from remote: centos-base
2021-01-14 22:27:08.692 | CentOS-8 - Base 2.2 MB/s | 2.3 MB 00:01
2021-01-14 22:27:09.248 | centos-base: using metadata from Thu Jan 7 08:51:01 2021.
2021-01-14 22:27:09.249 | repo: downloading from remote: centosplus
2021-01-14 22:27:09.783 | CentOS-8 - Plus 1.1 MB/s | 593 kB 00:00
2021-01-14 22:27:09.987 | centosplus: using metadata from Tue Dec 8 10:14:00 2020.
2021-01-14 22:27:10.594 | Completion plugin: Generating completion cache...
2021-01-14 22:27:10.595 | Completion plugin: Can't write completion cache: attempt to write a readonly database
2021-01-14 22:27:10.596 | No package centos-release available.
2021-01-14 22:27:10.596 | Exiting due to strict setting.
2021-01-14 22:27:10.599 | Error: No package centos-release available.
2021-01-14 22:27:10.641 | Failed to download initial packages: basesystem filesystem setup centos-release centos-linux-release centos-linux-repos centos-gpg-keys
2021-01-14 22:27:10.643 | dib-run-parts 08-yum-chroot completed

As indicated, centos8 does not have a 'centos-release' package. The package name is `centos-linux-release.` Looking in 08-yum-chroot, I see that's been addressed in the code block starting at line 92:

 92 # CentOS 8.1 split repositories and GPG keys out into subpackages
 93 if [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE} > "7" ]]; then
 94 packages+="centos-linux-release centos-linux-repos centos-gpg-keys "
 95
 96 if [[ "$DIB_RELEASE" =~ (stream) ]]; then
 97 packages+="centos-stream-release centos-stream-repos "
 98 fi
 99 fi

However, an earlier block incorrectly adds 'centos-release' to the packages list:

 76 if [[ ${DISTRO_NAME} = fedora && ${DIB_RELEASE} -gt 29 ]]; then
 77 packages+="fedora-release-cloud fedora-release-common "
 78 else
 79 packages+="${DISTRO_NAME}-release "
 80 fi

The test needs to be updated to exclude adding "${DISTRO_NAME}-release" if ${DISTRO_NAME} is 'centos' and DIB_RELEASE is > 7.

Tim Randles (trandles)
description: updated
Revision history for this message
Martin Chlumsky (martin-chlumsky) wrote :

I've encountered this as well.

What I don't understand is why it fails. centos-release is provided by the centos-linux-release package.

The command `dnf install centos-release` just works in centos-8 normally.

# dnf provides centos-release
Last metadata expiration check: 0:00:29 ago on Wed Jan 20 03:27:33 2021.
centos-linux-release-8.3-1.2011.el8.noarch : CentOS Linux release files
Repo : @System
Matched from:
Provide : centos-release = 8.3-1.2011.el8

centos-linux-release-8.3-1.2011.el8.noarch : CentOS Linux release files
Repo : baseos
Matched from:
Provide : centos-release = 8.3-1.2011.el8

Changed in diskimage-builder:
status: New → Confirmed
Revision history for this message
Martin Chlumsky (martin-chlumsky) wrote :

So I got past this issue.

We were using the docker image centos:8.2.2004 to build the CentOS 8 image. We install diskimage-builder inside the container and run dib from there.

We switched to using centos:8.3.2011 instead and the issue has resolved itself.

Changed in diskimage-builder:
status: Confirmed → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.