Bug 2124519

Summary: Upgrade fails when no content is synced
Product: Red Hat Satellite Reporter: Radek Mynar <rmynar>
Component: Satellite MaintainAssignee: Evgeni Golov <egolov>
Status: CLOSED WONTFIX QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.11.2CC: apatel, aupadhye, chiggins, dalley, egolov, ehelms, gtalreja, kgaikwad, lpramuk, lvrtelov, osousa
Target Milestone: UnspecifiedKeywords: PrioBumpQA, Regression, Triaged, Upgrades
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-1.1.5-1.el8sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-26 18:08:30 UTC 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 Radek Mynar 2022-09-06 12:08:18 UTC
Description of problem:
Upgrade tries to change ownership of /var/lib/pulp/media/artifact directory which does not exist until some content is synced. This causes the upgrade to fail.

Version-Release number of selected component (if applicable):
-

How reproducible:
always

Steps to Reproduce:
1. Install Satellite 6.10
2. Don't sync any repositories
3. Attempt to upgrade to 6.11
 subscription-manager repos --enable rhel-7-server-satellite-maintenance-6.11-rpms
 satellite-maintain upgrade list-versions
 satellite-maintain upgrade check --target-version 6.11
 satellite-maintain upgrade run --target-version 6.11

Actual results:
Upgrade check reports no errors, but upgrade fails with following error:
 Fix Pulpcore artifact ownership to be pulp:pulp: 
 / # chown -hR pulp.pulp /var/lib/pulp/media/artifact                  [FAIL]    
 No such file or directory - /var/lib/pulp/media/artifact

Expected results:
Upgrade should be successful even if the directory does not exist. Maybe the step should be skipped or the directory created...

Additional info:
The upgrade step was introduced in bz2106501

Comment 1 Evgeni Golov 2022-09-08 09:33:00 UTC
Created redmine issue https://projects.theforeman.org/issues/35506 from this bug

Comment 2 Evgeni Golov 2022-09-08 09:47:15 UTC
Radek, can you try the patch in https://github.com/theforeman/foreman_maintain/pull/642?

Comment 3 Bryan Kearney 2022-09-08 12:04:56 UTC
Upstream bug assigned to egolov

Comment 4 Bryan Kearney 2022-09-08 12:04:58 UTC
Upstream bug assigned to egolov

Comment 5 Radek Mynar 2022-09-12 15:31:51 UTC
(In reply to Evgeni Golov from comment #2)
> Radek, can you try the patch in
> https://github.com/theforeman/foreman_maintain/pull/642?

Hi Evgeni,

I applied the patch and upgrade went successfully on a machine with no content synced.

Comment 6 juwatts 2022-09-13 15:20:36 UTC
*** Bug 2121544 has been marked as a duplicate of this bug. ***