Running "satellite-maintain content remove-pulp2" command fails with error Device or resource busy after upgrading to Red Hat Satellite 6.10

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.10
  • Red Hat Capsule 6.10

Issue

  • After upgrading to Red Hat Satellite\Capsule 6.10, The satellite-maintain content remove-pulp2 command could fail to remove certain directories if they are active filesystem mount points.

       - 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 [Remove Pulp2 and mongodb packages and data] failed.
    
    
       or
    
    
       - Deleting pulp2 data directories                                     [FAIL]
       Failed executing rm -rf /var/cache/pulp, exit status 1:
        rm: cannot remove '/var/cache/pulp': Device or resource busy
        --------------------------------------------------------------------------------
       Scenario [Remove Pulp2 and mongodb packages and data] failed.
    

Resolution

  • This behavior has been reported to the Red Hat Engineering team via Bugzilla This content is not included.2027567. The reported issue has been fixed with the release of Red Hat Satellite 6.10.5.

  • To manually complete the cleanup process, follow the mentioned steps on the affected Satellite or Capsule server.

       # rm -rf /var/lib/mongodb/*
       # umount /var/lib/mongodb
    
       # rm -rf /var/cache/pulp/*
       # umount /var/cache/pulp
    
       # vi /etc/fstab 
    
          --> Comment out the entries for /var/lib/mongodb/ and /var/cache/pulp/ mount points if there is any
    
  • Re-execute the remove-pulp2 step to ensure the successful execution of the cleanup process.

    # satellite-maintain content remove-pulp2
    # satellite-maintain service restart
    # sleep 20 && hammer ping
    

 

For more KB articles/solutions related to Red Hat Satellite 6.x Pulp 2.0 to Pulp 3.0 Migration Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Pulp 2.0 to Pulp 3.0 Migration Issues

Root Cause

  • The satellite-maintain content remove-pulp2 command tries to run the following two commands as a part of the cleanup process.

    All pulp2 data will be removed.
    
    # rm -rf /var/lib/mongodb/
    # rm -rf /var/cache/pulp
    
    • Since the commands are targetting the entire directories, if any or both of them are active mount points for some filesystems, then some process will be using them and the deletion attempt of the directories will fail.
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.