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 2105898 - Removing pulp2 content fails during Upgrade to 6.11 when on dedicated mount points
Summary: Removing pulp2 content fails during Upgrade to 6.11 when on dedicated mount p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.11.0
Hardware: All
OS: Linux
high
medium
Target Milestone: 6.11.1
Assignee: satellite6-bugs
QA Contact: Gaurav Talreja
URL:
Whiteboard:
Depends On: 2027567
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-11 06:22 UTC by Evgeni Golov
Modified: 2022-07-27 17:27 UTC (History)
20 users (show)

Fixed In Version: rubygem-foreman_maintain-1.0.14
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2027567
Environment:
Last Closed: 2022-07-27 17:27:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman_maintain pull 600 0 None Merged Fixes #34699 - don't try to delete pulp mountpoints 2022-07-11 13:16:07 UTC
Red Hat Product Errata RHBA-2022:5742 0 None None None 2022-07-27 17:27:22 UTC

Description Evgeni Golov 2022-07-11 06:22:24 UTC
# satellite-maintain upgrade run --target-version 6.11
- Removing pulp2 packages                                                       
\ Removing mongo packages                                                       
\ Removing additional packages                                                 
/ Dropping migration tables                                                     
- Dropping migrations                                                           
| Deleting pulp2 data directories                                     [FAIL]   
Failed executing rm -rf /var/lib/mongodb/, exit status 1:
 rm: cannot remove ‘/var/lib/mongodb/’: Device or resource busy
--------------------------------------------------------------------------------
Scenario [Procedures before migrating to Satellite 6.11] failed.


A viable workaround should be:
1. install f-maintain from 6.10 (0.8.31)
2. explicitly remove pulp2 content: satellite-maintain content remove-pulp2
3. re-run the actuall 6.11 upgrade


+++ This bug was initially created as a clone of Bug #2027567 +++

Description of problem:

After upgrading to 6.10, the remove pulp2 content step fails if one of the directories being removed are dedicated mount points.


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


How reproducible:
Everytime

Steps to Reproduce:
1. Create a 6.9 Satellite with /var/lib/mongodb as a dedicated mount point.
2. Upgrade to 6.10
3. Try removing the pulp2 content:
~~~
# satellite-maintain content remove-pulp2
~~~

Actual results:
The below output is seen:
~~~
Failed executing rm -rf /var/lib/mongodb/, exit status 1:
 rm: cannot remove ‘/var/lib/mongodb/’: Device or resource busy
--------------------------------------------------------------------------------
Scenario [Remove Pulp2 and mongodb packages and data] failed.

The following steps ended up in failing state:

  [pulp-remove]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="pulp-remove"
~~~


Expected results:
Pulp2 content should be removed graciously, check if any of the directories being deleted are dedicated mounts or not. If they are, then delete the contents inside them but not delete the directory itself as that will still be an active mount.

Comment 3 Gaurav Talreja 2022-07-21 09:33:29 UTC
Hi,

Tested upgrade to Satellite 6.11.1 Snap 2.2 from Satellite 6.9.9, with version rubygem-foreman_maintain-1.0.14-1.el7sat.noarch

Steps followed,
1. Prepared Satellite 6.9.9 with /var/lib/mongodb as a dedicated mount point, then upgraded to 6.10.7 
(Also, Tried adding a second pulp directory mount point to /var/cache/pulp.)
2. As "foreman-maintain content remove-pulp2" procedure is now run while upgrading to 6.11
  # foreman-maintain upgrade run --target-version 6.11 --whitelist 'repositories-validate,repositories-setup' 
...
--------------------------------------------------------------------------------
Add maintenance_mode tables/chain to nftables/iptables:               [OK]
--------------------------------------------------------------------------------
Remove pulp2:
/ Removing pulp2 packages
/ Removing mongo packages
| Removing additional packages
- Dropping migration tables
| Dropping migrations
- Deleted: /etc/pki/pulp/content
/var/lib/pulp/published
- The directories /var/lib/mongodb/,/var/cache/pulp are individual mountpoints.
The satellite-maintain won't delete these directories.
You need to remove content and these directories on your own.
\ stopping pulpcore-content
Warning: Stopping pulpcore-api.service, but it can still be activated by:
  pulpcore-api.socket

Warning: Stopping pulpcore-content.service, but it can still be activated by:
  pulpcore-content.socket
/ Done restarting pulpcore services                                   [OK]
--------------------------------------------------------------------------------
...

It seems that instead of fail-upgrading here, the steps above pass in upgrades when there are mount points listed by remove-pulp2 that cannot be deleted. Is this expected?


Thanks,
Gaurav

Comment 4 Evgeni Golov 2022-07-21 09:39:34 UTC
Yes, I think this is in line with what I'd expect.

Comment 6 Gaurav Talreja 2022-07-22 12:44:41 UTC
Ack, Thanks for confirming, I'm marking this BZ as verified

Comment 10 errata-xmlrpc 2022-07-27 17:27:10 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 (Satellite 6.11.1 Async Bug Fix Update), 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-2022:5742


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