Error: No matching repo to modify: ubi*. on RHEL 9 container build

Bug #1956319 reported by chandan kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Unassigned

Bug Description

While building the base container in RHEL-9 container build job, it is failing with following error in base/base-build.log.

```
Failed to set locale, defaulting to C.UTF-8
Updating Subscription Management repositories.
Unable to read consumer identity
Subscription Manager is operating in container mode.

This system is not registered with an entitlement server. You can use subscription-manager to register.

Error: No matching repo to modify: ubi*.
time="2021-12-23T10:08:51-05:00" level=debug msg="\"/var/tmp/buildah366822098/mnt/buildah-bind-target-11\" is apparently not really mounted, skipping"
time="2021-12-23T10:08:51-05:00" level=debug msg="\"/var/tmp/buildah366822098/mnt/buildah-bind-target-5\" is apparently not really mounted, skipping"
time="2021-12-23T10:08:51-05:00" level=debug msg="\"/var/tmp/buildah366822098/mnt/buildah-bind-target-4\" is apparently not really mounted, skipping"
time="2021-12-23T10:08:51-05:00" level=debug msg="\"/var/tmp/buildah366822098/mnt/rootfs\" is apparently not really mounted, skipping"
time="2021-12-23T10:08:51-05:00" level=debug msg="\"/var/tmp/buildah366822098/mnt\" is apparently not really mounted, skipping"
time="2021-12-23T10:08:51-05:00" level=debug msg="error building at step {Env:[PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin container=oci LANG=en_US.UTF-8] Command:run Args:[if [ -f \"/etc/yum.repos.d/ubi.repo\" ]; then dnf config-manager --set-disabled \"ubi*\" && dnf clean all && rm -rf /var/cache/dnf; fi] Flags:[] Attrs:map[] Message:RUN if [ -f \"/etc/yum.repos.d/ubi.repo\" ]; then dnf config-manager --set-disabled \"ubi*\" && dnf clean all && rm -rf /var/cache/dnf; fi Original:RUN if [ -f \"/etc/yum.repos.d/ubi.repo\" ]; then dnf config-manager --set-disabled \"ubi*\" && dnf clean all && rm -rf /var/cache/dnf; fi}: error while running runtime: exit status 1"

```

While looking at RHEL-9 ubi9 beta image.
```
[chandankumar@ovpn-9-86 multi-node-firewall]$ podman run -it 28b0a4b69d9b bash
[root@64eae93864b8 /]# cd /etc/yum.repos.d/
[root@64eae93864b8 yum.repos.d]# cat ubi.repo

[root@64eae93864b8 yum.repos.d]# cat /etc/redhat-release
Red Hat Enterprise Linux release 9.0 Beta (Plow)
[root@64eae93864b8 yum.repos.d]#

```

It is failing at following step: https://opendev.org/openstack/tripleo-common/src/branch/master/container-images/tcib/base/base.yaml#L2
```
run: if [ -f "/etc/yum.repos.d/ubi.repo" ]; then dnf config-manager --set-disabled "ubi*" && dnf clean all && rm -rf /var/cache/dnf; fi
```

Solution: Since we are already disabling the ubi.repo. So it make sense to get rid of the ubi.repo file completely.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)
Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.opendev.org/c/openstack/tripleo-common/+/823370
Committed: https://opendev.org/openstack/tripleo-common/commit/534f7f7584176fcb3a0266756281ed933bae7318
Submitter: "Zuul (22348)"
Branch: master

commit 534f7f7584176fcb3a0266756281ed933bae7318
Author: Chandan Kumar (raukadah) <email address hidden>
Date: Tue Jan 4 15:40:10 2022 +0530

    Remove /etc/yum.repos.d/ubi.repo

    in ubi9 beta image, /etc/yum.repos.d/ubi.repo is empty so
    disabled it via dnf fails and it breaks the container
    build.

    Removing this file completely fixes the issue.

    Closes-Bug: #1956319

    Signed-off-by: Chandan Kumar (raukadah) <email address hidden>
    Change-Id: I0cf3313e7bfb30f0e9cae1f4b8ce265a1e8996d2

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/tripleo-common/+/823451

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/tripleo-common/+/823451
Committed: https://opendev.org/openstack/tripleo-common/commit/a5471f8c949967c13c7f16ba3641cb8df226bf21
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit a5471f8c949967c13c7f16ba3641cb8df226bf21
Author: Chandan Kumar (raukadah) <email address hidden>
Date: Tue Jan 4 15:40:10 2022 +0530

    Remove /etc/yum.repos.d/ubi.repo

    in ubi9 beta image, /etc/yum.repos.d/ubi.repo is empty so
    disabled it via dnf fails and it breaks the container
    build.

    Removing this file completely fixes the issue.

    Closes-Bug: #1956319

    Signed-off-by: Chandan Kumar (raukadah) <email address hidden>
    Change-Id: I0cf3313e7bfb30f0e9cae1f4b8ce265a1e8996d2
    (cherry picked from commit 534f7f7584176fcb3a0266756281ed933bae7318)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 16.3.0

This issue was fixed in the openstack/tripleo-common 16.3.0 release.

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.