This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 984318 - Unable to delete application created from custom cartridge
Unable to delete application created from custom cartridge
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
1.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Hiro Asari
libra bugs
http://meteor-btg.rhcloud.com/
: SupportQuestion
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-14 17:33 EDT by David
Modified: 2013-11-03 20:50 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-27 13:35:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David 2013-07-14 17:33:03 EDT
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-14 23:02:57 EDT
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 13:01:22 EDT
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 17:05:30 EDT
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 17:53:28 EDT
(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 01:31:46 EDT
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 09:56:47 EDT
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 10:40:20 EDT
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 13:08:24 EDT
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 13:30:20 EDT
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 13:22:55 EDT
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 13:35:17 EDT
Thank you for the update, David. I'm closing this now.

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