Bug 843824 - The error message is unexpected after create an app and add the wrong template to the app
The error message is unexpected after create an app and add the wrong templa...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Krishna Raman
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-27 08:56 EDT by xjia
Modified: 2015-07-19 20:51 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-07 16:42:44 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 xjia 2012-07-27 08:56:54 EDT
Description of problem:
Create a quickstart template /tmp/foo.yaml with wrong packages, then add a wordpress template. When create an app and add the template to the app ,the error message is unexpected.

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

How reproducible:
always

Steps to Reproduce:
1.Create a quickstart template  - /tmp/foo.yaml with wrong packages
---
Vendor: unknown
Requires:
- php-xx
Architecture: noarch
Description:
License: unknown
Subscribes:
  doc-root:
    Required: false
    Type: FILESYSTEM:doc-root
Version: 0.0
2.Add a template
[root@ip-10-4-87-157 ~]# rhc-admin-ctl-template -c add -n wordpress -d /tmp/foo.yaml -g git://github.com/openshift/wordpress-example.git -t wordpress  --cost 1  -m '{"a":"b"}'  

It will show that:
Template 48e582e5b79b43c4a4dbd99d543c8fa4 created

3.Create an app and add the template to the app
[root@jason ~]# curl -k -X POST -H "Accept: application/xml" -H "Content-type: application/json" -d '{name:"myapp1", template: 48e582e5b79b43c4a4dbd99d543c8fa4}' --user xuan:dd https://ec2-23-22-110-87.compute-1.amazonaws.com/broker/rest/domains/xuan11/applications
  
Actual results:
<h1>
  NoMethodError
    in ApplicationsController#create
</h1>
<pre>You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.reverse</pre>

Expected results:
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <version>1.0</version>
  <type nil="true"></type>
  <messages>
    <message>
      <field nil="true"></field>
      <exit-code nil="true"></exit-code>
      <severity>error</severity>
      <text>Failed to create application myapp1 due to:Invalid cartridge specified: php-xx</text>
    </message>
  </messages>
  <status>internal_server_error</status>
  <data nil="true"></data>
</response>

Additional info:
Comment 1 Krishna Raman 2012-07-27 13:29:44 EDT
https://github.com/openshift/crankcase/pull/290
Comment 2 xjia 2012-07-30 01:15:43 EDT
1. Create a quickstart template  - /tmp/foo.yaml with wrong packages
[root@ip-10-86-205-90 ~]# cat /tmp/foo.yaml 
Vendor: unknown
Requires:
- php-xx
Architecture: noarch
Description:
License: unknown
Subscribes:
  doc-root:
    Required: false
    Type: FILESYSTEM:doc-root
Version: 0.0
You have new mail in /var/spool/mail/root

2. Add a template
[root@ip-10-86-205-90 ~]# rhc-admin-ctl-template -c add -n wordpress -d /tmp/foo.yaml -g git://github.com/openshift/wordpress-example.git -t wordpress  --cost 1  -m '{"a":"b"}'
Template 56a7ac7173414f0ba83073ef35a31e74 created

3.Create an app and add the template to the app
[root@jasontest test]# curl -k -X POST -H "Accept: application/xml" -H "Content-type: application/json" -d '{name:"myapp1", template: 56a7ac7173414f0ba83073ef35a31e74}' --user zizi:dd https://ec2-23-20-58-243.compute-1.amazonaws.com/broker/rest/domains/zizi/applications
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <messages>
    <message>
      <text>Failed to create application myapp1 due to: Invalid cartridge specified: php-xx</text>
      <exit-code>1</exit-code>
      <severity>error</severity>
      <field nil="true"></field>
    </message>
  </messages>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
  </supported-api-versions>
  <status>unprocessable_entity</status>
  <type nil="true"></type>
  <version>1.1</version>
  <data>
    <datum nil="true"></datum>
  </data>
</response>


The bug has been fixed.

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