Bug 2052561

Summary: remove-pulp2 will fail if /var/lib/mongodb is mountpoint
Product: Red Hat Satellite Reporter: Jan Jansky <jjansky>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Lai <ltran>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.10.2CC: saydas
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-21 08:24:18 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 Jan Jansky 2022-02-09 14:54:22 UTC
Description of problem:
If /var/lib/mongodb is mountpoint instead of simple folder
# satellite-maintain content remove-pulp2 will fail with error below.

/ 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

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

How reproducible:
Always


Steps to Reproduce:
1. Have Satellite 6.9 with /var/lib/mongodb as LVM (mountpoint)
2. Migrate content to pulp3
3. Upgrade to 6.10 (Content switchover as part of it)
4. # satellite-maintain content remove-pulp2


Actual results:
/ 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

Expected results:
Running Remove Pulp2 and mongodb packages and data
================================================================================
Remove pulp2:

WARNING: All pulp2 packages will be removed with the following commands:

# rpm -e pulp-docker-plugins  pulp-ostree-plugins  pulp-puppet-plugins  pulp-puppet-tools  pulp-rpm-plugins  pulp-selinux  pulp-server  python-bson  python-mongoenginctar  python-pulp-common  python-pulp-docker-common  python-pulp-integrity  python-pulp-oid_validation  python-pulp-ostree-common  python-pulp-puppet-common  python-p  python-pulp-rpm-common  python-pulp-streamer  python-pymongo  python-pymongo-gridfs  python2-amqp  python2-billiard  python2-celery  python2-django  python2-kombu    python2-vine  pulp-katello  pulp-maintenance  python3-pulp-2to3-migration
# yum remove rh-mongodb34-*
# yum remove squid mod_wsgi

All pulp2 data will be removed.

# rm -rf /var/lib/pulp/published
# rm -rf /var/lib/pulp/content
# rm -rf /var/lib/pulp/importers
# rm -rf /var/lib/pulp/uploads
# rm -rf /var/lib/mongodb/
# rm -rf /var/cache/pulp

Do you want to proceed?, [y(yes), q(quit)] y
\ Removing pulp2 packages
- Removing mongo packages
/ Removing additional packages
\ Dropping migration tables
/ Dropping migrations
- Done deleting pulp2 data directories
\ 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]
--------------------------------------------------------------------------------

Additional info:
As workaround can be /var/lib/mongodb umounted, updated fstab, remove-pulp2 and destroy LVM.

Comment 3 Jan Jansky 2022-03-21 08:24:18 UTC

*** This bug has been marked as a duplicate of bug 2027567 ***