RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1701290 - dnf exits with non-zero exit code on broken UBI 8 repo access
Summary: dnf exits with non-zero exit code on broken UBI 8 repo access
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-18 14:56 UTC by Ken Dreyer (Red Hat)
Modified: 2019-05-22 05:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-29 11:46:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1692452 0 high CLOSED [libdnf] Set skip_if_unavailable=false as default behavior for software management tools[ZStream Clone] 2021-02-22 00:41:40 UTC

Description Ken Dreyer (Red Hat) 2019-04-18 14:56:15 UTC
Description of problem:
DNF immediately exits with a "1" exit code if it cannot sync the cache on any broken repository.


Version-Release number of selected component (if applicable):
dnf-0.22.5-5.el8_0


How reproducible:
always

Steps to Reproduce:
1. Fire up the latest ubi8 container:

podman run -it --rm brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888\/ubi8:8.0-ondeck

2. Check the dnf version:

bash-4.4# rpm -qv libdnf
libdnf-0.22.5-4.el8.x86_64


3. Run "yum -y update", note the error strings:

bash-4.4# yum -y update
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Red Hat Universal Ba     [===                 ] ---  B/s |   0  B     --:-- ETA
Red Hat Universal Base Image 8 (RPMs) - AppStre 8.8  B/s |  16  B     00:01    
Red Hat Universal Base Image 8 (RPMs) - BaseOS   12  B/s |  16  B     00:01    
Failed to synchronize cache for repo 'ubi-8-appstream', ignoring this repo.
Failed to synchronize cache for repo 'ubi-8-baseos', ignoring this repo.
Dependencies resolved.
Nothing to do.

4. Note the exit code is zero with this dnf version:
bash-4.4# echo $?
0

5. Enable the RHEL 8 nightly repos
bash-4.4# cat /etc/yum.repos.d/rhel-8-nightly.repo 
[rhel-8-baseos-nightly]
name = RHEL 8 BaseOS nightly
baseurl = http://download.engineering.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8/compose/BaseOS/$basearch/os/
enabled = 1
gpgcheck = 0

[rhel-8-appstream-nightly]
name = RHEL 8 Appstream nightly
baseurl = http://download.engineering.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8/compose/AppStream/$basearch/os/
enabled = 1
gpgcheck = 0


6. Update libdnf to 0.22.5-5.el8_0
bash-4.4# yum -y update libdnf
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
RHEL 8 Appstream nightly                        1.3 MB/s | 5.3 MB     00:04    
RHEL 8 BaseOS nightly                           698 kB/s | 2.2 MB     00:03    
Red Hat Universal Base Image 8 (RPMs) - AppStre 8.7  B/s |  16  B     00:01    
Red Hat Universal Base Image 8 (RPMs) - BaseOS   12  B/s |  16  B     00:01    
Failed to synchronize cache for repo 'ubi-8-appstream', ignoring this repo.
Failed to synchronize cache for repo 'ubi-8-baseos', ignoring this repo.
Last metadata expiration check: 0:00:01 ago on Thu Apr 18 14:52:53 2019.
Dependencies resolved.
================================================================================
 Package           Arch      Version             Repository                Size
================================================================================
Upgrading:
 libdnf            x86_64    0.22.5-5.el8_0      rhel-8-baseos-nightly    574 k
 python3-hawkey    x86_64    0.22.5-5.el8_0      rhel-8-baseos-nightly     86 k
 python3-libdnf    x86_64    0.22.5-5.el8_0      rhel-8-baseos-nightly    619 k

Transaction Summary
================================================================================
Upgrade  3 Packages
...

7. Try any other yum operation, eg "yum update" or "yum install python3-setuptools"



Actual results:

bash-4.4# yum update
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Red Hat Universal Base Image 8 (RPMs) - AppStre  13  B/s |  16  B     00:01    
Error: Failed to synchronize cache for repo 'ubi-8-appstream'

bash-4.4# echo $?
1


Expected results:
DNF should treat the broken repository as a non-fatal error and continue on with the command, whether that's "yum update" or "yum install", etc.

Additional info:
dnf-0.22.5-4.el8 is the last version I see that worked.

Comment 1 Ken Dreyer (Red Hat) 2019-04-18 15:15:00 UTC
I guess our workaround will be to delete the ubi.repo file for now.

Comment 2 Ken Dreyer (Red Hat) 2019-04-18 17:19:29 UTC
Here's our workaround that deletes ubi.repo: https://github.com/ceph/ceph-container/pull/1352


Note You need to log in before you can comment on or make changes to this bug.