Bug 876525 - [US3046]Cartridges of created quickstart are missing If the quickstart created with JSON array format in community
Summary: [US3046]Cartridges of created quickstart are missing If the quickstart create...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Master
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-14 10:46 UTC by joycezhang
Modified: 2015-05-15 00:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-20 15:56:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
development log (58.03 KB, text/x-log)
2012-11-14 10:46 UTC, joycezhang
no flags Details
Error from web console (102.07 KB, image/png)
2012-11-14 10:46 UTC, joycezhang
no flags Details
full trace from site (8.27 KB, application/octet-stream)
2012-11-15 03:09 UTC, joycezhang
no flags Details
error.log (10.76 KB, text/plain)
2012-11-15 04:51 UTC, Wei Sun
no flags Details
CreatedQuickstart1116 (24.70 KB, image/png)
2012-11-16 08:44 UTC, joycezhang
no flags Details
Cartridges of the quickstart are missing 1116 (64.21 KB, image/png)
2012-11-16 08:45 UTC, joycezhang
no flags Details

Description joycezhang 2012-11-14 10:46:01 UTC
Created attachment 644750 [details]
development log

Description of problem:
The error "MultiJson::DecodeError in ApplicationTypesController#index" is shown after creating a quickstart with JSON array format in community.

Version-Release number of selected component (if applicable):
fork_ami_us3046_quickstarts_and_app_types_293
rhc-1.1.5.gem

How reproducible:
always

Steps to Reproduce:
1.Enable quickstarts on instance.
2.Log into community with admin/admin
3.Go to http://<server>/community/node/add/quickstart  to create a quickstart
4.Input title, tag and cartridges with JSON array as displayed in the UI as below:
[{"name": "php-5.3", "name": "mysql-5.1"}]
5.Save the quickstart and hit http://<server>/community/cron.php
6.Go to console to create an app with the created quickstart above.

Actual results:
Error is shown at attached.

Expected results:
App can be created with this quickstart.

Additional info:
It works well with this way :A comma delimited list of cartridge names: php-5.3, mysql-5.1

Comment 1 joycezhang 2012-11-14 10:46:46 UTC
Created attachment 644752 [details]
Error from web console

Comment 2 Clayton Coleman 2012-11-14 15:36:04 UTC
The story is merged to master now, fix is in pull-request https://github.com/openshift/origin-server/pull/898 to master

Comment 3 joycezhang 2012-11-15 03:08:11 UTC
This bug has not been fixed completely, Please refer to the details as below:

Build verion:
rhc.1.1.7.gem
devenv_2474

Verified steps:
1.Enable quickstarts on instance.
2.Log into community with admin/admin
3.Go to http://<server>/community/node/add/quickstart  to create a quickstart
4.Input title, tag and cartridges with JSON array as displayed in the UI as below:
[{"name": "php-5.3", "name": "mysql-5.1"}]
5.Save the quickstart and hit http://<server>/community/cron.php
6.Go to console to create an app with the created quickstart above.

Actual results:
1. The created quickstarts are not listed when accessing the create application page in console.
2. Try to search the created quickstarts by tags, the same error is occurred.

Expected results:
The created quickstarts should be listed in the console for application creation page, and it should be work well for app creation. 

Please refer to the full trace of site as attached.

Thanks.

Comment 4 joycezhang 2012-11-15 03:09:23 UTC
Created attachment 645305 [details]
full trace from site

Comment 5 Wei Sun 2012-11-15 04:51:42 UTC
Created attachment 645335 [details]
error.log

Test on devenv_2474.

I create a quickstart template and add a template on instance. Template 3e39113a4e8342098392f27f7fa17fb6 created.Then,I create an app and add the template to the app,but will display the error as attachment.

Comment 6 Clayton Coleman 2012-11-15 18:13:25 UTC
The info above is from submittiting to the broker - however you're sending invalid input so it's no surprise you get that error.  Possibly we should be more gracefully handling it

Comment 7 joycezhang 2012-11-16 08:43:33 UTC
(In reply to comment #6)
> The info above is from submittiting to the broker - however you're sending
> invalid input so it's no surprise you get that error.  Possibly we should be
> more gracefully handling it

Yes, I tried Restapi as below, it can work well on devenv_2485.
#curl -k -X POST -H "Accept: application/xml" -d name=myapp1 -d template=b682148cad584771a7fa6dff7fb3c4ad --user test:test https://ec2-50-16-140-44.compute-1.amazonaws.com/broker/rest/domains/testdm11/applications


However, for the quickstart created in community with JSON format, the actual results are different as before. Please refer to the details as below:


Steps:
1.Enable quickstarts on instance.
2.Log into community with admin/admin
3.Go to http://<server>/community/node/add/quickstart  to create a quickstart
4.Input title, tag and cartridges with JSON array as displayed in the UI as below:
[{"name": "php-5.3", "name": "mysql-5.1"}]
5.Save the quickstart and hit http://<server>/community/cron.php
6.Go to console to create an app with the created quickstart above.

Actual results:
The quickstart is listed in create application page, but the cartridges (php-5.3, mysql-5.1) are missing when creating app with this quickstart. What's more, the Create application button is invalid. It can not create app with this quickstart.

Please refer to the screenshot for the quickstart and create application page.

Comment 8 joycezhang 2012-11-16 08:44:43 UTC
Created attachment 646246 [details]
CreatedQuickstart1116

Comment 9 joycezhang 2012-11-16 08:45:54 UTC
Created attachment 646247 [details]
Cartridges of the quickstart are missing 1116

Comment 10 joycezhang 2012-11-16 08:48:31 UTC
Changed summary as actual results are different as before.

Comment 11 Lili Nader 2012-11-16 17:17:45 UTC
The error is coming from rails before even it gets to applications_controller. It is failing to parse JSON data. As far as I can know there is no graceful way of handling this.  The json input must be validated before sending.

Comment 12 manoj 2012-11-16 18:22:51 UTC
Lili to validate settings in prod.

Comment 13 Lili Nader 2012-11-16 21:22:14 UTC
Output from invalid JSON in production does not show the stacktrace.  So this is not a blocker for this sprint.

<!DOCTYPE html>
<html>
<head>
  <title>We're sorry, but something went wrong (500)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/500.html -->
  <div class="dialog">
    <h1>We're sorry, but something went wrong.</h1>
    <p>We've been notified about this issue and we'll take a look at it shortly.</p>
  </div>
</body>
</html>

Comment 14 Clayton Coleman 2012-11-18 16:48:53 UTC
If we decide to fix this in the future I believe "rescue_from MultiJson::DecodeError, ..." will allow us to intercept this parse error.  Would need similar logic for other content types.

Comment 15 Clayton Coleman 2012-11-19 14:54:00 UTC
Should be future featured.

Comment 16 manoj 2013-09-18 18:51:45 UTC
Need to fix or close this

Comment 17 Ravi Sankar 2013-10-01 20:20:53 UTC
Easy way to reproduce the bug is to pass headers twice to the REST api call.

Example:
curl -k --user 'ravip:nopass' -H "Accept: application/xml" -H "Content-type: application/json" https://localhost/broker/rest/domains/ravip/applications.xml -X POST -d name=app1 -d cartridge=php-5.3

Comment 18 Clayton Coleman 2013-10-02 17:49:05 UTC
Priority bumped down a bit.


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