Bug 868331 - JBoss Tools: Unable to deal with embedded cartridges
JBoss Tools: Unable to deal with embedded cartridges
Product: OpenShift Origin
Classification: Red Hat
Component: Master (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Lili Nader
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2012-10-19 10:20 EDT by Attila Nagy
Modified: 2015-05-14 20:52 EDT (History)
3 users (show)

See Also:
Fixed In Version: devenv_2366
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-11-06 13:49:00 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Attila Nagy 2012-10-19 10:20:15 EDT
Description of problem: JBoss Tools Eclipse plugin cannot deal with scaling applications.

Version-Release number of selected component (if applicable): devenv_2350 (ami-7c0ab415)
Eclipse Juno + JBoss OpenShift Tools 2.4.0.Alpha2-v20121002-1453-B40 (Installed from Eclipse Marketplace)

How reproducible: Always

Steps to Reproduce:
1. Open OpenShift New Application Wizard: File -> New -> Other... -> OpenShift Application
2. Provide your access credentials
3. Add application name + application type + choose 'Enable Scaling'
4. Next -> Next -> Finish

Actual results: Error pop-up is shown with the following message and OpenShift Explorer doesn't show embedded cartridge haproxy (command line tools does)

Could not embed cartridges for application testingscaling
Unknow request parameter type integer

Expected results: Scaling application must be created without any errors or warnings

Additional info:
Comment 1 Attila Nagy 2012-10-19 10:21:01 EDT
Additional note: this functionality works well in production environment.
Comment 2 Attila Nagy 2012-10-19 10:34:31 EDT
Additionally the same behavior is discovered during embedding cartridges.

Steps to Reproduce #1:
1. Open OpenShift New Application Wizard: File -> New -> Other... -> OpenShift Application
2. Provide your access credentials
3. Add application name + application type + choose one of the embedded cartridges
4. Next -> Next -> Finish

Steps to Reproduce #2:
1. Open OpenShift Explorer
2. Right click on the name of the application
3. Choose menu 'Edit Embedded Cartridges...'
4. Choose one of the embedded cartridges in the list
5. Click on 'Finish'
Comment 3 Lili Nader 2012-10-19 15:05:38 EDT
I will communicate with JBoss tools team about this bug.
Comment 4 Lili Nader 2012-10-19 20:09:46 EDT
Sent email to Jboss tools team.
Comment 5 Andre Dietisheim 2012-10-20 11:08:02 EDT
There's a bug related to embedding cartridges
Comment 6 Andre Dietisheim 2012-10-20 11:09:21 EDT
Thanks for reporting this issue. This was discovered when testing Alpha2 so I dont think that this is related to the following error in Beta1 when embedding cartridges:

Comment 7 Andre Dietisheim 2012-10-22 09:42:52 EDT
There's a change in the REST protocol that causes this. When we request the broker to add a cartridge to an application, the broker returns the freshly crearted (and added) resource to us. When embedding mysql, the returned json could look like this:

    "type" => "cartridges",
    "supported_api_versions" => [
        big decimal 1.0,
        big decimal 1.1,
        big decimal 1.2
    "data" => [{
        "type" => "embedded",
        "status_messages" => undefined,
        "name" => "mysql-5.1",
        "properties" => {
            "username" => "admin",
            "connection_url" => "mysql://",
            "info" => "Connection URL: mysql://",
            "database_name" => "ba",
            "password" => "ruWyzLFih2b2"
        "links" => {
            "DELETE" => {

Now the latest REST protocol apparently returns a link for an UPDATE action which holds optional parameters of type <b>"integer"</b>:

            "UPDATE" => {
                "href" => "https://ec2-107-20-102-82.compute-1.amazonaws.com/broker/rest/domains/somedomain/applications/ba/cartridges/mysql-5.1",
                "required_params" => [],
                "method" => "PUT",
                "optional_params" => [
                        "name" => "additional_storage",
                        "type" => "integer",
                        "name" => "scales_from",
                        "type" => "integer",
                        "name" => "scales_to",
                        "type" => "integer",
                "rel" => "Update cartridge configuration"

These new type make the openshift-java-client fail in the unmarshalling since it's only aware of String and Boolean types so far. 
I'd ask you to push this change to protocol 1.1 and up since you'd otherwise break our existing clients (JBoss Tools, etc.).
Comment 9 Lili Nader 2012-10-23 18:00:25 EDT
fixed in devenv_2366
Comment 10 Andre Dietisheim 2012-10-24 03:40:32 EDT
@Lili: so what did you exactly fix? I'd appreciate some comments.
Comment 11 Andre Dietisheim 2012-10-24 04:23:39 EDT
so in https://github.com/lnader/origin-server/commit/73ce66d14930631f65b790bf0d5687514b7fa54e you apparently removed the integer link parameters for rest proto 1.0 (proto 1.1 in https://github.com/lnader/origin-server/blob/master/controller/lib/openshift-origin-controller/app/models/rest_cartridge11.rb still has them). 
So that would mean that the latest OpenShift would - in prot 1.0 - not provide the integer parameters and break the openshift-java-client, right?
Comment 12 Attila Nagy 2012-10-24 10:07:45 EDT
Verified against devenv_2372

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