Bug 989856 - Can not add cartridge with redhat-cartridgename-version via RESTAPI
Can not add cartridge with redhat-cartridgename-version via RESTAPI
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Lili Nader
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-30 01:10 EDT by Wei Sun
Modified: 2015-05-14 20:55 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-07 18:58:11 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 Wei Sun 2013-07-30 01:10:49 EDT
Description of problem:
Create app or add cartridge with redhat-cartridgename-version via REST API,but it failed.It returns "<text>Unable to complete the requested operation due to: undefined method `components' for #&lt;Array:0x00000004e3db78&gt;.
Reference ID: 39c2b8c5d8bdb78437929724b4e254ec</text>"

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

How reproducible:
Always

Steps to Reproduce:
1.Create app  with redhat-cartridgename-version via REST API
2.Add cartridge with redhat-cartridgename-version via REST API
3.

Actual results:
1.[wsun@dhcp-8-229 ~]$ curl -k -H 'Accept: application/xml' -u wsun@redhat.com:redhat https://ec2-54-221-12-128.compute-1.amazonaws.com/broker/rest/domains/wsundev3580t/applications -d name=phptt -d cartridges[]=redhat-php-5.3 -X POST
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>internal_server_error</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Unable to complete the requested operation due to: undefined method `components' for #&lt;Array:0x00000004e3db78&gt;.
Reference ID: 39c2b8c5d8bdb78437929724b4e254ec</text>
      <exit-code>1</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>

2.[wsun@dhcp-8-229 ~]$ curl -k -H 'Accept: application/xml' -u wsun@redhat.com:redhat https://int.openshift.redhat.com/broker/rest/domains/wsunint/applications/phpt/cartridges -d name=redhat-mongodb-2.2 -X POST
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>internal_server_error</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Unable to complete the requested operation due to: undefined method `components' for #&lt;Array:0x0000000584d960&gt;.
Reference ID: 9635d24f0662e0687c32c134e4fe85d1</text>
      <exit-code>1</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>


Expected results:
Can create app and add cartridge with redhat-cartridgename-version

Additional info:
Comment 3 Wei Sun 2013-07-31 08:13:55 EDT
Check this bug on devenv_3592,could create app with redhat-cartridgename-version ,but could not add cartridge with redhat-cartridgename-version

Result:
[root@ip-10-147-220-197 ~]# curl -k -H 'Accept: application/xml' -u wsun@redhat.com:redhat https://ec2-54-225-47-114.compute-1.amazonaws.com/broker/rest/domains/wsundev3592/applications/phptt/cartridges -d name=redhat-mongodb-2.2 -X POST
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>internal_server_error</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Unable to complete the requested operation due to: undefined method `components' for #&lt;Array:0x00000006ae4d30&gt;.
Reference ID: ff0977490432dd81085fc9e0bef4c906</text>
      <exit-code>1</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>
Comment 4 Lili Nader 2013-07-31 14:43:51 EDT
Fix for embedded carts
https://github.com/openshift/origin-server/pull/3247
Comment 5 openshift-github-bot 2013-07-31 16:38:44 EDT
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/ebdedae4e0018132969ddec38e7c2fb8a0a14f7f
Bug 989856 - fix for embedded carts
Comment 6 Wei Sun 2013-07-31 23:09:23 EDT
Verified on devenv-stage_429.

Result:
[root@ip-10-165-26-124 ~]# curl -k -H 'Accept: application/xml' -u wsun@redhat.com:channgeme https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/domains/wsundevstg429/applications/phpt/cartridges -d name=redhat-mongodb-2.2 -X POST
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>created</status>
  <type>cartridge</type>
  <data>
    <cartridge>
      <name>mongodb-2.2</name>
      <status-messages nil="true"></status-messages>
      <version>2.2</version>
      <display-name>MongoDB NoSQL Database 2.2</display-name>
      <description>MongoDB is a scalable, high-performance, open source NoSQL database.</description>
      <license>ASL 2.0</license>
      <license-url></license-url>
      <tags>
        <tag>service</tag>
        <tag>database</tag>
        <tag>nosql</tag>
        <tag>embedded</tag>
      </tags>
      <website>http://www.10gen.com</website>
      <url nil="true"></url>
      <type>embedded</type>
      <usage-rates/>
      <scales-from>1</scales-from>
      <scales-to>1</scales-to>
      <current-scale>1</current-scale>
      <gear-profile>small</gear-profile>
      <base-gear-storage>1</base-gear-storage>
      <additional-gear-storage>0</additional-gear-storage>
      <collocated-with>
        <collocated-with>php-5.3</collocated-with>
      </collocated-with>
      <supported-scales-from>1</supported-scales-from>
      <supported-scales-to>1</supported-scales-to>
      <properties>
        <property>
          <name>username</name>
          <type>cart_data</type>
          <description>Root user on mongo database</description>
          <value>admin</value>
        </property>
        <property>
          <name>password</name>
          <type>cart_data</type>
          <description>Password for root user on mongo database</description>
          <value>_Bzw7NY7fB18</value>
        </property>
        <property>
          <name>database_name</name>
          <type>cart_data</type>
          <description>Mongo DB name</description>
          <value>phpt</value>
        </property>
        <property>
          <name>connection_url</name>
          <type>cart_data</type>
          <description>Mongo DB connection URL</description>
          <value>mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/</value>
        </property>
      </properties>
      <scales-with nil="true"></scales-with>
      <help-topics>
        <help-topic>
          <Building-with-MongoDB>https://www.openshift.com/developers/mongodb</Building-with-MongoDB>
        </help-topic>
      </help-topics>
      <links>
        <link>
          <rel>Get cartridge</rel>
          <method>GET</method>
          <href>https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/applications/894184375200056197775360/cartridges/mongodb-2.2</href>
          <required-params/>
          <optional-params/>
        </link>
        <link>
          <rel>Update cartridge configuration</rel>
          <method>PUT</method>
          <href>https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/applications/894184375200056197775360/cartridges/mongodb-2.2</href>
          <required-params/>
          <optional-params>
            <optional-param>
              <name>additional_gear_storage</name>
              <type>integer</type>
              <description>Additional filesystem storage in gigabytes on each gear having cartridge mongodb-2.2</description>
              <valid-options/>
              <default-value nil="true"></default-value>
            </optional-param>
            <optional-param>
              <name>scales_from</name>
              <type>integer</type>
              <description>Minimum number of gears having cartridge mongodb-2.2</description>
              <valid-options/>
              <default-value nil="true"></default-value>
            </optional-param>
            <optional-param>
              <name>scales_to</name>
              <type>integer</type>
              <description>Maximum number of gears having cartridge mongodb-2.2</description>
              <valid-options/>
              <default-value nil="true"></default-value>
            </optional-param>
          </optional-params>
        </link>
        <link>
          <rel>Start embedded cartridge</rel>
          <method>POST</method>
          <href>https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/applications/894184375200056197775360/cartridges/mongodb-2.2/events</href>
          <required-params>
            <param>
              <name>event</name>
              <type>string</type>
              <description>event</description>
              <valid-options>
                <valid-option>start</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
        <link>
          <rel>Stop cartridge</rel>
          <method>POST</method>
          <href>https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/applications/894184375200056197775360/cartridges/mongodb-2.2/events</href>
          <required-params>
            <param>
              <name>event</name>
              <type>string</type>
              <description>event</description>
              <valid-options>
                <valid-option>stop</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
        <link>
          <rel>Restart cartridge</rel>
          <method>POST</method>
          <href>https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/applications/894184375200056197775360/cartridges/mongodb-2.2/events</href>
          <required-params>
            <param>
              <name>event</name>
              <type>string</type>
              <description>event</description>
              <valid-options>
                <valid-option>restart</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
        <link>
          <rel>Reload cartridge</rel>
          <method>POST</method>
          <href>https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/applications/894184375200056197775360/cartridges/mongodb-2.2/events</href>
          <required-params>
            <param>
              <name>event</name>
              <type>string</type>
              <description>event</description>
              <valid-options>
                <valid-option>reload</valid-option>
              </valid-options>
              <invalid-options/>
            </param>
          </required-params>
          <optional-params/>
        </link>
        <link>
          <rel>Delete cartridge</rel>
          <method>DELETE</method>
          <href>https://ec2-23-20-32-96.compute-1.amazonaws.com/broker/rest/applications/894184375200056197775360/cartridges/mongodb-2.2</href>
          <required-params/>
          <optional-params/>
        </link>
      </links>
    </cartridge>
  </data>
  <messages>
    <message>
      <severity>info</severity>
      <text>Added redhat-mongodb-2.2 to application phpt</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
    </message>
    <message>
      <severity>debug</severity>
      <text>mongodb-2.2: Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/
</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
    </message>
    <message>
      <severity>result</severity>
      <text>MongoDB 2.2 database added.  Please make note of these credentials:
   Root User:     admin
   Root Password: _Bzw7NY7fB18
   Database Name: phpt
Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/
</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>

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