Bug 1928998

Summary: Getting "Repository not found" error when disabling RHEL 8 repositories on Satellite 6.8
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: ajambhul, ankulkar, francesco.trentini, iballou, momran, pdwyer, saydas
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: UnusedFlags: saydas: needinfo? (hyu)
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hao Chang Yu 2021-02-16 00:02:02 UTC
Description of problem:
Can't disable a rhel 8 repository on Satellite 6.8 if it was enabled on older Satellite version (Satellite 6.6 and older). This issue is caused by incorrect arch that Satellite uses to resolve all RHEL 8 repos. The database is storing "x86_64" but Satellite is looking for "noarch" when disabling the repository. Therefore, "Repository not found" error is raised. This is affecting the RHEL 8 repositories that were enabled on older Satellite version (Satellite 6.6 and older). When enabling a RHEL 8 repository, the older Satellite version will set its arch to "x86_64". However, Satellite 6.8 will set its arch to "noarch".

Steps to Reproduce:
1. Enable a rhel 8 repository on Satellite 6.6, such as rhel 8 baseos or appstreams
2. Upgrade the Satellite to 6.8
3. Disable the rhel 8 repository

Actual results:
Repository not found

Expected results:
Repository can be disabled successfully

Additional info:

This issue can be workaround by changing the root repo's arch from x86_64 to noarch.

foreman-rake console
Katello::RootRepository.where(name: ["Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs x86_64 8", "Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs x86_64 8", "Red Hat Satellite Tools 6.7 for RHEL 8 x86_64 RPMs x86_64"]).update_all(arch: "noarch")
exit

Comment 1 Sayan Das 2022-03-16 12:18:57 UTC
This seems the same scenario as explained in 

1973329 – Provide upstream repository name value to allow a name change on the repository to not break Satellite if an enabled repository's name gets changed
https://bugzilla.redhat.com/show_bug.cgi?id=1973329


Hello Hao, Can you please check in https://bugzilla.redhat.com/show_bug.cgi?id=1973329#c4 and confirm the same ?


I guess, It would be best to have just one of the BZs alive and worked on if the end goal is the same.




-- Sayan