Bug 843824 - The error message is unexpected after create an app and add the wrong template to the app
Summary: The error message is unexpected after create an app and add the wrong templa...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Krishna Raman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-27 12:56 UTC by xjia
Modified: 2015-07-20 00:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-07 20:42:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description xjia 2012-07-27 12:56:54 UTC
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 17:29:44 UTC
https://github.com/openshift/crankcase/pull/290

Comment 2 xjia 2012-07-30 05:15:43 UTC
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.