Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1591137

Summary: Upgrade failing in step 'packages-update' when /var/cache/yum is mounted as device
Product: Red Hat Satellite Reporter: Steffen Froemer <sfroemer>
Component: Satellite MaintainAssignee: Amit Upadhye <aupadhye>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2.14CC: apatel, aupadhye, bkearney, inecas, kgaikwad, mbacovsk
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: foreman_maintain-0.2.9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 12:58:36 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 Steffen Froemer 2018-06-14 07:05:55 UTC
Description of problem:
The upgrade of satellite 6.3 is impossible, when yum-cache directory is mounted directly

Version-Release number of selected component (if applicable):
rubygem-foreman_maintain-0.1.5-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. mount /dev/sdb /var/cache/yum
2. # foreman-maintain upgrade run --target-version 6.3


Actual results:
Running Migration scripts to Satellite 6.3
================================================================================
Setup repositories:
| Configuring repositories for 6.3                                    [OK]
--------------------------------------------------------------------------------
Update package(s) :
Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager
Cleaning repos: rhel-7-server-rpms rhel-7-server-satellite-6.3-rpms
              : rhel-7-server-satellite-maintenance-6-rpms rhel-7-server-satellite-tools-6.3-rpms
              : rhel-server-rhscl-7-rpms
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed                       repos
Uploading Enabled Repositories Report
Loaded plugins: product-id, subscription-manager
                                                                      [FAIL]
Failed executing rm -rf /var/cache/yum, exit status 1:
rm: cannot remove ‘/var/cache/yum’: Device or resource busy
--------------------------------------------------------------------------------
Scenario [Migration scripts to Satellite 6.3] failed.
 
The following steps ended up in failing state:
 
  [packages-update]

Expected results:
No error


Additional info:

Changing the rb-file workaround this issue

/usr/share/gems/gems/foreman_maintain-0.1.5/lib/foreman_maintain/concerns/system_helpers.rb

...
- 109         execute!('rm -rf /var/cache/yum')
+ 109         execute!('rm -rf /var/cache/yum/*')
...

==> adding '/*' at the end of the command

Comment 2 Kavita 2018-06-18 03:32:29 UTC
Created redmine issue http://projects.theforeman.org/issues/23969 from this bug

Comment 3 Satellite Program 2018-09-03 14:02:23 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/23969 has been resolved.

Comment 4 Kavita 2019-07-12 09:03:58 UTC
This issue is fixed in foreman_maintain-0.2.9.

Comment 6 Jameer Pathan 2020-03-16 07:11:30 UTC
Verified

Verified with:
- Satellite 6.7 snap 15
- rubygem-foreman_maintain-0.5.2-1.el7sat.noarch

Test steps:
1. # mount /dev/sdb /var/cache/yum
2. # foreman-maintain upgrade run --target-version 6.7.z --whitelist="repositories-setup,repositories-validate,check-epel-repository"

Observation:
- Satellite upgrade completed successfully.
- No error/issues observed.

Comment 8 errata-xmlrpc 2020-04-14 12:58:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1442