Bug 894948

Summary: [fork][model refactor] Unable to destroy application when the app's working directory is removed
Product: OKD Reporter: Jianwei Hou <jhou>
Component: ContainersAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: abhgupta, cgole, dmcphers
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fork_ami_refctr1_406+ Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-17 02:13:47 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:
Attachments:
Description Flags
broker log
none
mcollective log none

Description Jianwei Hou 2013-01-14 05:40:00 UTC
Created attachment 678022 [details]
broker log

Description of problem:
After removing the applications's working directory(/var/lib/openshift/$UUID), the app can not be destroyed properly, therefore, the http proxy config remains uncleaned and broken application can't be deleted from the domain. 

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

How reproducible:
Always

Steps to Reproduce:
1. Create an application
2. SSH into instance, remove  application's directory
mv /var/lib/openshift/50f394bd26338149130000a0 /tmp/
3. Delete application from client
  
Actual results:
hjw@hjw ~$ rhc app delete p1 -px
Are you sure you wish to delete the 'p1' application? (yes|no): yes

Deleting application 'p1' ... The server did not respond correctly. This may be an issue with the server configuration or with your connection to the server (such as a Web proxy or firewall).Please verify that you can access the OpenShift server https://ec2-204-236-253-70.compute-1.amazonaws.com/broker/rest/domains/404t/applications/p1


Expected results:
App should be deleted successfully, the remaining http proxy config should be removed as well

Additional info:
This is a regression bug of Bug 825354
broker log and mcollective log is attached.

Comment 1 Jianwei Hou 2013-01-14 05:40:31 UTC
Created attachment 678023 [details]
mcollective log

Comment 2 Abhishek Gupta 2013-01-14 22:30:17 UTC
Fixed in fork_ami_refctr1_406+

Comment 3 Jianwei Hou 2013-01-17 01:40:34 UTC
Verified on fork_ami_refctr1_420

Steps:
1. Create an application
2. SSH into instance, remove  application's directory
mv /var/lib/openshift/50f7552f02fea96608000004 /tmp/
3. Delete application from client

Result:
The application is deleted successfully.
Data are cleared from mongo as well

Comment 4 Chandrika Gole 2013-01-17 01:48:10 UTC
The app gets deleted, but if you try to create a new app with the same name it throws this error - 
The supplied application name 'php1' already exists

1. CReate an app php1
2. Delete the app dir mv /var/lib/openshift/299a465252864f3e958913a710221080  /tmp/
3. Delete app 

[root@ip-10-152-166-254 ~]# rhc app delete -a php1
Password: 
Are you sure you wish to delete the 'php1' application? (yes|no): yes
Deleting application 'php1' ... 
[root@ip-10-152-166-254 ~]# 

4. Create a  new app with the same name
[root@ip-10-152-166-254 ~]# rhc app create  -a php1 -t php-5.3

Password: 

Application Options
===================
  Gear Size: default
  Scaling:   no
  Namespace: cgole2
  Cartridge: php-5.3

Creating application 'php1' ... The supplied application name 'php1' already exists

Comment 5 Chandrika Gole 2013-01-17 02:13:47 UTC
testing this on  fork_ami_refctr1_420 and it works 
Ignore comment 3