+++ This bug was initially created as a clone of Bug #884418 +++ Description of problem: The app gear directory was deleted from the file system in /var/lib/openshift, we are trying to clean up the gear from the db by using oo-admin-ctl-app, but the command always failed. Version-Release number of selected component (if applicable): OpenShift Enterprise puddle: 1.1.x/2013-01-14.3 How reproducible: Always Steps to Reproduce: 1.Create an app and remove the gear dir from node in /var/lib/openshift/<uuid> 2.Log into the broker, run the command: # oo-admin-ctl-app -b -a <app_name> -l <login> -c destroy Actual results: [root@ip-10-196-118-123 openshift]# oo-admin-ctl-app -b -a app2 -l gpei -c destroy /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.2.3/app/models/application.rb:373:in `destroy': Could not destroy all gears of application. (OpenShift::NodeException) from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.2.3/app/models/application.rb:332:in `cleanup_and_delete' from /usr/sbin/oo-admin-ctl-app:154:in `<main>' Expected results: The app could be destroyed successfully. Additional info:
This would be very useful for operation administrator, so raise the Severity to "medium"
Could you try "force-destroy" instead of destroy? This is what ops appears to do. It merits documentation if that's the path they should take.
$ rhc app create app1 -t php -p redhat Then I got uuid: 5ebc05f7271e4b42ac41f9a402aaf36b Then on the node that my gear is on, I did like this. # cd /var/lib/openshift/ # rm -rf 5ebc05f7271e4b42ac41f9a402aaf36b #ssh broker root@broker's password: [root@broker ~]# oo-admin-ctl-app -a app1 -l zsun -c force-destroy !!!! WARNING !!!! WARNING !!!! WARNING !!!! You are about to destroy the app1 application. This is NOT reversible, all remote data for this application will be forcefully removed. Do you want to forcefully destroy this application (y/n): y WARNING: Check gear 5ebc05f7271e4b42ac41f9a402aaf36b on node 'node1.rhn.com', because destroy did not succeed cleanly. The gear may exist on node, but not in database. WARNING: Please check and fix the user's consumed_gear count vs the actual gears consumed, as they may be out of sync. Success It is okay if I use "force-destroy", However,the bug has been fixed before in origin (see https://bugzilla.redhat.com/show_bug.cgi?id=853559) and it regresses now.
The fix is supposed to be on the backend, as dmac said "This case needs to be handled by app-destroy on the node." I can't see the pull request anymore but I agree we should fix it. For now the workaround is "force-destroy".
We're going to pick this up with the next rebase.