brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Macartney (JIRA)" <>
Subject [jira] [Commented] (BROOKLYN-444) Effector call works from GUI but fails from CLI
Date Tue, 28 Feb 2017 15:01:45 GMT


Geoff Macartney commented on BROOKLYN-444:

I've investigated this and the problem lies in the version of CXF used by the REST server.

The request from the CLI is valid, noting that there is no content and so 
no request body (and Content-Length is zero). 

POST /v1/applications/effector-test/entities/esp/effectors/DoStuff HTTP/1.1
Host: geoffs-macbook-pro.local:8081
User-Agent: Go-http-client/1.1
Content-Length: 0
Authorization: Basic BlaBlaBlaBlaBla=
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip

The problem is in the {{org.apache.cxf.jaxrs.utils.FormUtils.populateMapFromString()}} method,

which, in the 3.1.4 version we are using, is assuming that the request body will not be null,
but will have at least one pair of parameters. This was fixed in commit
which is present in CXF releases from 3.1.6 onward.

This problem should therefore be resolved when we move up to more recent CXF versions,
specifically when is merged.

> Effector call works from GUI but fails from CLI
> -----------------------------------------------
>                 Key: BROOKLYN-444
>                 URL:
>             Project: Brooklyn
>          Issue Type: Bug
>    Affects Versions: 0.10.0
>         Environment: Brooklyn Version 0.10.0 on Mac
>            Reporter: Murdo Aird
>            Assignee: Geoff Macartney
>            Priority: Critical
> The following simple BP adds an Effector to an entity. The entity can be called from
the web UI and succeeds. Drilling into the Activity logs shows the simple bash command works.
> However if I try to invoke the Effector via the CLI [1], the call fails:
> br app "effector-test" entity "Empty Software Process" effector DoStuff invoke
> For the CLI failure, it looks like a random (?) environment variable is being injected
via the CLI [2].
> {code:none}
> name: effector-test
> location: localhost
> services:
>   - type:
>     install.command: echo True
>     launch.command: echo True
>     checkRunning.command: echo true
>     brooklyn.initializers:
>       - type: org.apache.brooklyn.core.effector.ssh.SshCommandEffector
>         brooklyn.config:
>           name: DoStuff
>           command: whoami
> {code}
> * Calling a standard Effector (e.g. stop) via the CLI works. 
> * If the DoSuff Effector via CLI fails, I can subsequently call it from the web UI and
it works
> Not to muddy the waters, but calling the same Effector from the REST API also results
in an error - but it's a different one [3].
> [1]
> [2]
> [3]

This message was sent by Atlassian JIRA

View raw message