Bug 1021467

Summary: Could not delete app after failed to create app on INT
Product: OpenShift Online Reporter: Wei Sun <wsun>
Component: PodAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: sparks, yadu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:25:51 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:

Description Wei Sun 2013-10-21 11:08:10 UTC
Description of problem:
After failed to create app,try to delete this app,but could not delete app successfully.But run `rhc domain show`,this broken app is still listed.

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

How reproducible:
Always

Steps to Reproduce:
1.Create an application ,but failed
2.Run `rhc domain show`
3.Delete this broken app

Actual results:
1.rhc app create nds nodejs-0.6 mysql-5.1 mongodb-2.2 postgresql-8.4 -s --no-git --no-dns -g large --server int.openshift.redhat.com -l wsun+1
Application Options
-------------------
  Domain:     wsun1int
  Cartridges: nodejs-0.6, mysql-5.1, mongodb-2.2, postgresql-8.4
  Gear Size:  large
  Scaling:    yes

Creating application 'nds' ... exception: connect failed

2.openshift@openshift-ubuntu:~$ rhc domain show
Please sign in to start a new session to int.openshift.redhat.com.
Password: ******

Domain wsun1int (owned by wsun+1)
--------------------------------------------
  Created:            Oct 18 12:53 AM
  Allowed Gear Sizes: small, medium, large

 nds @ http://nds-wsun1int.int.rhcloud.com/ (uuid: 5264eda86cec0e38c6000262)
  ---------------------------------------------------------------------------
    Domain:     wsun1int
    Created:    5:02 AM
    Gears:      2 (defaults to large)
    Git URL:    ssh:///~/git/nds.git/
    SSH:        ssh://
    Deployment: manual (use 'rhc deploy')

3.openshift@openshift-ubuntu:~/test$ rhc delete-app nds -l wsun+1 
This is a non-reversible action! Your application code and data will be permanently deleted if you continue!

Are you sure you want to delete the application 'nds'? (yes|no): yes

Deleting application 'nds' ... 
Unable to complete the requested operation due to: undefined method `set_user_env_vars' for #<Gear:0x000000072bf500>.
Reference ID: c423d67ca3ec556ae712763a6acdb40d

Expected results:
Could delete this app successfully

Additional info:

Comment 1 Yan Du 2013-10-21 11:24:27 UTC
met the same problem on INT, can't delete app after failed to create app.
then the account is broken and always show the below error when creating app.


[root@localhost dataprepare]# rhc app delete cnodejs010salldbjkns84 --confirm -l yadu+m
Deleting application 'cnodejs010salldbjkns84' ... 
createuser: creation of new role failed: ERROR:  role "adminwh6a3sg" already exists
/var/lib/openshift/5264f51a03ef6404100000ae/postgresql/bin/post_install: line 13: error: command not found



[root@localhost dataprepare]# rhc app create phpsqlmyadmin php-5.3 mysql-5 phpmyadmin --no-git
Using mysql-5.1 (MySQL 5.1) for 'mysql-5'
Using phpmyadmin-4 (phpMyAdmin 4.0) for 'phpmyadmin'

Application Options
-------------------
  Domain:     aaa
  Cartridges: php-5.3, mysql-5.1, phpmyadmin-4
  Gear Size:  default
  Scaling:    no

Creating application 'phpsqlmyadmin' ... 
createuser: creation of new role failed: ERROR:  role "adminwh6a3sg" already exists
/var/lib/openshift/5264f51a03ef6404100000ae/postgresql/bin/post_install: line 13: error: command not found

Comment 2 Eric Christensen 2013-10-21 13:32:22 UTC
I, too, am seeing this problem although I suspect mine failed to build because I used an incorrect git repo.  I've got two applications that I cannot remove, though.

Comment 3 openshift-github-bot 2013-10-22 02:52:35 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/fcae2c3d7778d645758352fcdc6a006d95c29e96
Fix for bug 1020440, 1021041, 1021462, 1021467, and a typo

Comment 4 Abhishek Gupta 2013-10-22 17:05:23 UTC
Fixed with --> https://github.com/openshift/origin-server/pull/3939

Comment 6 Wei Sun 2013-10-23 09:53:41 UTC
Check this bug on STG(devenv-stage_528),could not reproduce this bug,could create and delete app successfully,and could delete app successfully after app failed to build.

Comment 7 Wei Sun 2013-10-23 09:56:00 UTC
Will verify this bug after checking on INT

Comment 8 Wei Sun 2013-10-23 10:57:36 UTC
Try to create an application with  incorrect download cartridge in STG(devenv-stage_528),when the creation failed,the app creating is rolled back successfully.

Comment 9 Wei Sun 2013-10-25 05:17:04 UTC
Checked broken app in INT(devenv_3942),the broken app is deleted.

Tried to create an application with  incorrect download cartridge,when the creation failed,the app creating is rolled back successfully.

So verify this bug.

Comment 10 Eric Christensen 2013-10-25 14:09:25 UTC
When the applications delete do you see your gears being released or are they still being shown as in use?  I'm using 4 gears but showing that 8 are being used after the broken apps were removed.

Comment 11 Wei Sun 2013-10-26 04:28:01 UTC
Check my account,after the broken app was removed,my gears were released.I'm using 10 gears,and showing that 10 gears are being used.