Bug 984318

Summary: Unable to delete application created from custom cartridge
Product: OpenShift Online Reporter: David <dpwhittaker>
Component: ContainersAssignee: Hiro Asari <hasari>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 1.xCC: agrimm, bmeng, dpwhittaker, hasari, jhonce, jkeck, wsun, xtian
Target Milestone: ---Keywords: SupportQuestion
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://meteor-btg.rhcloud.com/
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-27 17:35:17 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 David 2013-07-14 21:33:03 UTC
Description of problem:
C:\Users\David>rhc app delete meteor -d
DL is deprecated, please use Fiddle
DEBUG: Using config file C:/Users/David/.openshift/express.conf
DEBUG: Authenticating with RHC::Auth::Token
DEBUG: Connecting to https://openshift.redhat.com/broker/rest/api
DEBUG: Getting all domains
DEBUG: Client supports API versions 1.1, 1.2, 1.3, 1.4, 1.5
DEBUG: Using token authentication
DEBUG: Request GET https://openshift.redhat.com/broker/rest/api
DEBUG:    code 200 2501 ms
DEBUG: Server supports API versions 1.0, 1.1, 1.2, 1.3, 1.4, 1.5
DEBUG: Using token authentication
DEBUG: Request GET https://openshift.redhat.com/broker/rest/domains
DEBUG:    code 200  106 ms
DEBUG: Getting all domains
DEBUG: Using token authentication
DEBUG: Request GET https://openshift.redhat.com/broker/rest/domains/btg/applicat
ions/meteor
DEBUG:    code 200  127 ms
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 'meteor'? (yes|no): yes

Deleting application 'meteor' ... DEBUG: Deleting application meteor
DEBUG: Using token authentication
DEBUG: Request DELETE https://openshift.redhat.com/broker/rest/domains/btg/appli
cations/meteor
DEBUG:    code 500 10465 ms
DEBUG: Response did not include a message from server: invalid character at "<!D
OCTYPE "

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://openshift.redhat.com/broker/rest/domains/btg/applications/meteor

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


How reproducible:
Every time


Steps to Reproduce:
1. Attempt to create cartridge from https://github.com/dpwhittaker/openshift-meteor-cartridge (by linking to the manifest raw link: https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/metadata/manifest.yml
2. App creates with errors, cartridge is not listed
3. Try to delete app, get message above

Actual results:
The app is inaccessible to ssh, ping, rhc, and the web console.

Expected results:
App created with cartridge, and able to ssh into it to find installation errors.

Additional info:
all three of my free gears are now affected (trying to troubleshoot)
http://meteor-btg.rhcloud.com/
http://meteorcart-btg.rhcloud.com/
http://meteorcarttest-btg.rhcloud.com/

Comment 1 Wei Sun 2013-07-15 03:02:57 UTC
Test on devenv-stage_404,I can create the app with custom cartridge (https://raw.github.com/bmeng/downloadable-mock/master/metadata/manifest.yml),and can delete the app successfully.

Comment 2 Andy Grimm 2013-07-15 17:01:22 UTC
I have deleted your apps.  It may take some time for your "consumed gears" count to catch up, due to the way force-deletions work.

I will separately try to reproduce this issue with the information you've provided.  Thanks.

Comment 3 Hiro Asari 2013-07-15 21:05:30 UTC
Hello,

How did you create this app? I tried:

$ bx bin/rhc app create meteor https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/metadata/manifest.yml
The cartridge 'https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/metadata/manifest.yml' will be downloaded and installed

Application Options
-------------------
  Namespace:  fooooooooooo
  Cartridges: https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'meteor' ... 
Unable to complete the requested operation due to: Node execution failure (invalid exit code from node).  If the problem persists please contact Red Hat support..
Reference ID: a941916bdd90bc546e5b44dad2f3ba8b

Comment 4 David 2013-07-15 21:53:28 UTC
(In reply to Hiro Asari from comment #3)
> Hello,
> 
> How did you create this app? I tried:
> 
> $ bx bin/rhc app create meteor
> https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/
> metadata/manifest.yml
> The cartridge
> 'https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/
> metadata/manifest.yml' will be downloaded and installed
> 
> Application Options
> -------------------
>   Namespace:  fooooooooooo
>   Cartridges:
> https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/
> metadata/manifest.yml
>   Gear Size:  default
>   Scaling:    no
> 
> Creating application 'meteor' ... 
> Unable to complete the requested operation due to: Node execution failure
> (invalid exit code from node).  If the problem persists please contact Red
> Hat support..
> Reference ID: a941916bdd90bc546e5b44dad2f3ba8b

That is one of the ways I tried to create the app (the other was through the console).  I got the same error message.  But then the Application was created, but had no cartridges in the console.

Comment 5 Meng Bo 2013-07-16 05:31:46 UTC
After tried to create app with the cartridge, it gets failure, and cannot find the app after that on denenv-stage_406.

[root@ip-10-151-24-170 ~]# rhc app create app1 https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/metadata/manifest.yml
The cartridge 'https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/metadata/manifest.yml' will be downloaded and installed

Application Options
-------------------
  Namespace:  bmeng
  Cartridges: https://raw.github.com/dpwhittaker/openshift-meteor-cartridge/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'app1' ... 
Unable to complete the requested operation due to: Node execution failure (invalid exit code from node).  If the problem persists please contact Red Hat support..
Reference ID: cefb601d9ab1d067b699d0f4a7893dc0
[root@ip-10-151-24-170 ~]# rhc domain show
The domain bmeng exists but has no applications. You can use 'rhc create-app' to create a new application.

Comment 6 Hiro Asari 2013-07-16 13:56:47 UTC
David,

As you can see, there are many things we can improve during the custom cartridge development cycle. It is rather difficult to understand how things went south without the access to the server logs.

I spent a little time examining your cartridge, and found a few mistakes.

1. The process_templates value in managed_files.yml needs to be a string literal.

2. Scripts under 'bin' are executed directly, so they need to have the executable bit on. ('chmod +x' on UNIX; perhaps there is a GUI dialog on Windows)

3. Currently, 'bin/control' appears to have DOS line endings. Since it will be executed on a Linux machine, the line endings should be '\n', not '\r\n'.

4. Environment variables need to be "published". For example, the Node.js cartridge makes them available like this: https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-nodejs/metadata/manifest.yml.0.6#L19-L49

Additionally, study how bin/setup in the Node.js cartridge creates directories so that logs can be subsequently created.

There may be more issues to consider, but those will probably involve design decisions that only you can answer.

Some of these issues are undoubtedly due to incomplete documentation (https://github.com/openshift/origin-server/blob/master/node/README.writing_cartridges.md). We will work on that.

In the meantime, make the changes shown above, and let us know how it goes.

Thank you.

Comment 7 Hiro Asari 2013-07-16 14:40:20 UTC
Also, the bash functions cannot have empty bodies, so status() and friends need to have something (as simple as just "true") in it.

status(), by the way, needs to echo correct message in order to function correctly. See what other cartridges are doing.

Comment 8 David 2013-07-17 17:08:24 UTC
I'm sort of weekend warrior on this project.  Thanks for taking the time to look at it, and I'll try these out when I get a few free hours.

Comment 9 Hiro Asari 2013-07-25 17:30:20 UTC
David, any update on this?

Seems the initial problem with the application deletion failure was an anomaly, and I have provided some additional pointers for your cartridge.

If there is nothing else to address, may we close this ticket?

Comment 10 David 2013-07-27 17:22:55 UTC
Sure, I'll just open a new bug if these suggestions dont help when I get to it.

Comment 11 Hiro Asari 2013-07-27 17:35:17 UTC
Thank you for the update, David. I'm closing this now.