Bug 839211

Summary: Failed created app can not be destroyed and user can not create app any more
Product: OKD Reporter: Xiaoli Tian <xtian>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 1.xCC: dmcphers, jialiu, rmillner
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-13 23:43:52 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
failed app failed to destroy broker log
none
Manual destroy failed app log
none
Failed to create app again broker log none

Description Xiaoli Tian 2012-07-11 08:54:43 UTC
Description of problem:
If the app creating failed, it still shows in rhc domain show, while destorying it, it shows:
#rhc app destroy -a scalejboss1 -l xtian+t100 -p1
RSULT:
Could not destroy all gears of application.

When try to create another new app, it shows:
#rhc app create -a scalejboss2  -t jbossas-7 -s  -l xtian+t100 -p 1 --enable-jenkins  

Found existing Jenkins application: jenkins
Creating application: scalejboss2 in domainxdev001
/usr/local/share/gems/gems/rhc-0.95.12/lib/rhc-common.rb:519:in `create_app': undefined method `uuid' for []:Array (NoMethodError)
	from /usr/local/share/gems/gems/rhc-0.95.12/bin/rhc-app:230:in `create_app'
	from /usr/local/share/gems/gems/rhc-0.95.12/bin/rhc-app:505:in `<top (required)>'
	from /usr/local/bin/rhc-app:23:in `load'
	from /usr/local/bin/rhc-app:23:in `<main>'



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

How reproducible:
Not always

Steps to Reproduce:
1.Remove the following file from your ~/.ssh/config if you have it 
Host *.dev.rhcloud.com
    IdentityFile ~/.ssh/id_rsa
    VerifyHostKeyDNS yes
    StrictHostKeyChecking no
    UserKnownHostsFile ~/.ssh/known_hosts

2.Remove ~/.ssh/known_hosts if it exists
3.Create an app but not type yes at once when it ask you if you want to continue:
[root@F17x64-openshift 711]# rhc app create -a scalejboss1 -l xtian+t100 -p 123456  -t jbossas-7 -s 

Creating application: scalejboss1 in domainxdev001
Now your new domain name is being propagated worldwide (this might take a minute)...
    retry # 4 - Waiting for DNS: scalejboss1-domainxdev001.dev.rhcloud.com
The authenticity of host 'scalejboss1-domainxdev001.dev.rhcloud.com (107.22.138.212)' can't be established.
RSA key fingerprint is ad:2c:f7:ed:fc:cb:0f:ff:cb:73:f9:c7:15:96:da:b9.
Are you sure you want to continue connecting (yes/no)?

4. Wait for several minutes and type yes

5. Check your domain show, and server log:
it's listed in your domain, some error in broker log (see detail in attachment):

Consistency check failed.  Could not update application 'scalejboss1' for 'xtian+t100'
#<StickShift::UserException: Consistency check failed.  Could not update application 'scalejboss1' for 'xtian+t100'>

5. Try to destroy it   

#rhc app destroy -a scalejboss1 -l xtian+t100 -p1
RSULT:
Could not destroy all gears of application.
Some log in broker:

Unable to clean up application on gear #<Gear:0x7f293c294b38> due to exception Unable to destroy gear on node
["/usr/lib/ruby/gems/1.8/gems/stickshift-controller-0.13.12/lib/stickshift-controller/app/models/gear.rb:69:in `destroy'"

6. Create new app for this user failed:


Expected results:
Failed created app could be destroyed at least, new app could be created as well

Additional info:

Comment 1 Xiaoli Tian 2012-07-11 08:55:54 UTC
Created attachment 597507 [details]
failed app failed to destroy broker log

Comment 2 Xiaoli Tian 2012-07-11 08:58:15 UTC
Created attachment 597509 [details]
Manual destroy failed app log

Comment 3 Xiaoli Tian 2012-07-11 09:00:56 UTC
Created attachment 597511 [details]
Failed to create app again broker log

Comment 4 Johnny Liu 2012-07-11 12:40:44 UTC
I also encouter this issue too.

Reproduce it easily, create a scalbe app, then destroy it.

Comment 5 Dan McPherson 2012-07-11 14:49:33 UTC
I haven't been able to recreate with the steps from comment 1 or comment 4.

Comment 6 Dan McPherson 2012-07-11 14:59:27 UTC
Rajat,  I can't recreate but have a feeling this is related to your changes.  Can you take a look.

Comment 7 Dan McPherson 2012-07-11 15:15:24 UTC
Actually it looks more like Ravi's changes.  I would like to talk about what's going on here.

Comment 8 Ravi Sankar 2012-07-11 21:25:32 UTC
Code changes for Bug#835176 caused this issue. Fixed in git rev. 870689373c3.

Comment 9 Johnny Liu 2012-07-12 07:13:32 UTC
Verified this bug on devenv-stage_223, try serveral times, all PASSed.