Bug 980928 - there's no message with field "result" in the messages that I get when creating cartridges/applications
there's no message with field "result" in the messages that I get when creati...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity urgent
: ---
: ---
Assigned To: Lili Nader
libra bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-03 10:42 EDT by Andre Dietisheim
Modified: 2015-05-14 20:55 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-22 11:20:38 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBIDE-15115 Blocker Closed No confirmation dialog is reported back to user after embedding cartridges 2013-09-06 15:29:50 EDT

  None (edit)
Description Andre Dietisheim 2013-07-03 10:42:01 EDT
Description of problem:
When creating an application or a cartridge (that I embed) I expect the result of this operation in the messages "block". In protocol 1.2 I had so far something like this:

"messages":[
      {
        "exit_code":null,
         "field":null,
         "severity":"info",
         "text":"Application jekyll was created."
      },
      {
         "exit_code":0,
         "field":"current_ip",
         "severity":"info",
         "text":"107.21.169.102"
      },
      {
         "exit_code":0,
         "field":"result",
         "severity":"info",
         "text":"\nJenkins created successfully.  Please make note of these credentials:\n\n   User: admin\n   Password: edWlFXhq-BqY\n\nNote:  You can change your password at: https://jekyll-foobarz.rhcloud.com/me/configure\n\n"
      }
   ],

There's a field "result" that I show to the user in the OpenShift tools for Eclipse. 
In the latest version OpenShift is not giving me a "results" fields any more and thus breaks my existing clients. I get something like this (when embedding mysql):

"messages": [
    {
        "exit_code" => big integer 0,
        "field" => undefined,
        "severity" => "info",
        "text" => "Added mysql-5.1 to application as71"
    },
    {
        "exit_code" => big integer 0,
        "field" => undefined,
        "severity" => "debug",
        "text" => "

mysql-5.1: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT
"
    },
    {
        "exit_code" => big integer 0,
        "field" => undefined,
        "severity" => "result",
        "text" => "MySQL 5.1 database added.  Please make note of these credentials:
       Root User: adminv15iriK
   Root Password: nyZ77qp5-h61
   Database Name: as71
Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/
You can manage your new MySQL database by also embedding phpmyadmin-3.4.
The phpmyadmin username and password will be the same as the MySQL credentials above.
"
    }
]

Version-Release number of selected component (if applicable):
protocol 1.2

How reproducible:
always

Steps to Reproduce:
1. embed mysql to an existing application
2. check the response for "messages": and see if there's a field "result"
3.

Actual results:
No "result" field is present and thus existing clients for the EClipse tooling dont get the required informations (like url, credentials)

Expected results:
I should get a "result" field that I can show to the user as we could with the prior implementations

Additional info:
Comment 1 Clayton Coleman 2013-07-03 10:46:34 EDT
This is a regression in behavior for old API clients which breaks processing of cartridge response data (which contains critical information).

Older API versions should continue to have their correct behavior.  This blocks the release of the Eclipse client tools, and in all likelihood needs to be hotfixed to production.
Comment 2 weiwei jiang 2013-07-03 23:01:06 EDT
tested on jboss tool 4.1.0 cr1 and found that return no messages after add cartridge to app now
Comment 3 Andre Dietisheim 2013-07-06 05:29:37 EDT
We had to freeze CR1 yesterday which should become GA without any changes in the ideal case. We could therefore not wait for a hotfix and worked around it by looking either for a "result" field or a "result" severity in the "default" fields. 

https://github.com/jbosstools/jbosstools-openshift/pull/188/files#L5R79

This allows us that our tooling works with current Online and existing OSE instances.
Comment 4 weiwei jiang 2013-07-08 06:12:48 EDT
test on jbosstool 4.1.0 CR1a and it works, thx
And when add some non-supported cartridges for scalable app, the result of supported cartridge will not display.
Comment 5 Andre Dietisheim 2013-07-08 14:42:06 EDT
(In reply to weiwei jiang from comment #4)
> test on jbosstool 4.1.0 CR1a and it works, thx

thanks for confirming weiwei

> And when add some non-supported cartridges for scalable app, the result of
> supported cartridge will not display.

did I read you right, if you try to embed/create unsupported cartridges you wont get any report about it?
Is this expected or should a dialog pop up?
Comment 6 weiwei jiang 2013-07-08 22:00:12 EDT
(In reply to Andre Dietisheim from comment #5)
> (In reply to weiwei jiang from comment #4)
> > test on jbosstool 4.1.0 CR1a and it works, thx
> 
> thanks for confirming weiwei
> 
> > And when add some non-supported cartridges for scalable app, the result of
> > supported cartridge will not display.
> 
> did I read you right, if you try to embed/create unsupported cartridges you
> wont get any report about it?
> Is this expected or should a dialog pop up?

For example, I embed mysql(supported) & phpmyadmin(unsupported) cartridge to a scalable php application, so it will pop up a dialog and display "phpmyadmin unsupported for scalable application", but it wont display the username&password of mysql, so is it expected?
Comment 7 Andre Dietisheim 2013-07-09 08:04:39 EDT
@weiwei: thanks for finding this, I filed it into our jira (I wont attach it to this issue here since this here is not related):

https://issues.jboss.org/browse/JBIDE-15157
Comment 8 Lili Nader 2013-07-09 15:14:31 EDT
The fix for this bug is in pull request


https://github.com/openshift/origin-server/pull/3014

For API versions 1.5 or earlier any messages with severity=result will also have the field set to result.

Note:This is a fix for backward compatibility.  As of version 1.6 (not released yet) the clients should check severity instead of the field attribute.  The field attribute indicates the message is related to a particular attribute of the resource and is used for validation errors.
Comment 9 Andre Dietisheim 2013-07-09 17:04:11 EDT
(In reply to Lili Nader from comment #8)
> The field attribute indicates the message is related to a
> particular attribute of the resource and is used for validation errors.

So for protocol <1.6 in case of success, the property "field" is always undefined?
Comment 10 Andre Dietisheim 2013-07-09 17:05:21 EDT
> So for protocol <1.6 in case of success, the property "field" is always
> undefined?

sorry, mistyped, should say "So for protocol >=1.6 in case of success, the property "field" is always undefined?
Comment 11 Lili Nader 2013-07-10 05:02:17 EDT
Yes
Comment 12 Lili Nader 2013-07-10 05:04:11 EDT
*** Bug 982615 has been marked as a duplicate of this bug. ***
Comment 13 Xiaoli Tian 2013-07-10 06:26:22 EDT
Hi, Lili

Even if the stage pull request is merged, but the master pull request is still not merged and not have [merge] tag yet:

https://github.com/openshift/origin-server/pull/3017

And there's no devenv-stage_399 ready, so it's not ready for testing now.

Thanks
Comment 14 zhaozhanqi 2013-07-11 04:32:40 EDT
check this issue on devenv-stage_399, it has not been fixed  and check the code /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.10.7/lib/openshift/controller/api_responses.rb
did not find the new added code. please confirm. thanks
Comment 17 Jianwei Hou 2013-07-12 07:33:44 EDT
Verified on devenv_3491
the value of 'field' is corrected.

 "messages": [
    {
      "exit_code": 0,
      "field": null,
      "severity": "info",
      "text": "Added mysql to application php1"
    },
    {
      "exit_code": 0,
      "field": null,
      "severity": "debug",
      "text": "\n\nmysql-5.1: Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT\n"
    },
    {
      "exit_code": 0,
      "field": "result",
      "severity": "result",
      "text": "MySQL 5.1 database added.  Please make note of these credentials:\n       Root User: adminbR8iT1a\n   Root Password: 2ZUQKAwW4mln\n   Database Name: php1\nConnection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/\nYou can manage your new MySQL database by also embedding phpmyadmin-3.4.\nThe phpmyadmin username and password will be the same as the MySQL credentials above.\n"
    }
  ],
  "status": "created",
  "supported_api_versions": [
    1.0,
    1.1,
    1.2,
    1.3,
    1.4,
    1.5
  ],
  "type": "cartridge",
  "version": "1.5"

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