Bug 1591137 - Upgrade failing in step 'packages-update' when /var/cache/yum is mounted as device
Summary: Upgrade failing in step 'packages-update' when /var/cache/yum is mounted as d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.2.14
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: 6.7.0
Assignee: Amit Upadhye
QA Contact: Jameer Pathan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-14 07:05 UTC by Steffen Froemer
Modified: 2021-09-09 14:34 UTC (History)
6 users (show)

Fixed In Version: foreman_maintain-0.2.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 12:58:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 23969 0 High Closed Upgrade failing in step 'packages-update' when /var/cache/yum is mounted as device 2020-04-24 09:14:35 UTC
Red Hat Product Errata RHBA-2020:1442 0 None None None 2020-04-14 12:58:48 UTC

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


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