Bug 895970 - Remove app failed by using oo-admin-ctl-app when app gear dir doesn't exist
Summary: Remove app failed by using oo-admin-ctl-app when app gear dir doesn't exist
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 1.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 884418
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-16 12:03 UTC by Ziqian SUN (Zamir)
Modified: 2017-03-08 17:35 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 884418
Environment:
Last Closed: 2013-03-07 21:04:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ziqian SUN (Zamir) 2013-01-16 12:03:33 UTC
+++ 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:

Comment 2 Johnny Liu 2013-01-16 14:49:08 UTC
This would be very useful for operation administrator, so raise the Severity to "medium"

Comment 3 Luke Meyer 2013-01-16 17:53:51 UTC
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.

Comment 4 Ziqian SUN (Zamir) 2013-01-17 02:31:01 UTC
$ 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.

Comment 5 Luke Meyer 2013-01-17 14:30:52 UTC
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".

Comment 8 Brenton Leanhardt 2013-03-07 21:04:58 UTC
We're going to pick this up with the next rebase.


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