[jboss-jira] [JBoss JIRA] (WFCORE-4460) jboss-cli.sh doesn't return json when the output command is 'failed'

Ingo Weiss (Jira) issues at jboss.org
Tue May 7 05:59:00 EDT 2019


     [ https://issues.jboss.org/browse/WFCORE-4460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ingo Weiss updated WFCORE-4460:
-------------------------------
    Steps to Reproduce: 
Step 1. Restart a JBoss server or host;

Step 2. During the upstart of the server/host, run the command:

{noformat}
/opt/jboss/jboss7_2/jboss-eap-7.2/bin/jboss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server=*/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json
{noformat}
or equivalent for your environment. Notice that the response will NOT be in JSON-format, it will be in the DMR format.

The following output was generated following the above steps:

{noformat}
[tosorio at localhost bin]$ ./jboss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server='*'/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json
{
    "outcome" => "failed",
    "result" => [{
        "address" => [
            ("host" => "master"),
            ("server" => "server-two"),
            ("deployment" => "fabrica.war")
        ],
        "outcome" => "failed",
        "result" => {
            "content" => [{
                "hash" => bytes {
                    0x73, 0xa2, 0x23, 0xaf, 0x5b, 0xb3, 0x3f, 0xc0,
                    0xaf, 0x84, 0x56, 0x33, 0x99, 0xfb, 0x6c, 0xa6,
                    0xd1, 0xf1, 0x58, 0x40
                },
                "archive" => undefined
           (...)
    "rolled-back" => true
{noformat}
---
  However, when the server is completely restarted, the json ouput works properly:



  was:
Step 1. Restart a JBoss server or host;

Step 2. During the upstart of the server/host, run the command:

/opt/jboss/jboss7_2/jboss-eap-7.2/bin/jboss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server=*/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json

or equivalent for your environment. Notice that the response will NOT be in JSON-format, it will be in the DMR format.

The following output was generated following the above steps:

{noformat}
[tosorio at localhost bin]$ ./jboss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server='*'/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json
{
    "outcome" => "failed",
    "result" => [{
        "address" => [
            ("host" => "master"),
            ("server" => "server-two"),
            ("deployment" => "fabrica.war")
        ],
        "outcome" => "failed",
        "result" => {
            "content" => [{
                "hash" => bytes {
                    0x73, 0xa2, 0x23, 0xaf, 0x5b, 0xb3, 0x3f, 0xc0,
                    0xaf, 0x84, 0x56, 0x33, 0x99, 0xfb, 0x6c, 0xa6,
                    0xd1, 0xf1, 0x58, 0x40
                },
                "archive" => undefined
           (...)
    "rolled-back" => true
{noformat}
---
  However, when the server is completely restarted, the json ouput works properly:





> jboss-cli.sh doesn't return json when the output command is 'failed'
> --------------------------------------------------------------------
>
>                 Key: WFCORE-4460
>                 URL: https://issues.jboss.org/browse/WFCORE-4460
>             Project: WildFly Core
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 9.0.0.Beta4
>         Environment: JBoss EAP 7.2.0 running in domain mode.
>            Reporter: Ingo Weiss
>            Assignee: Ingo Weiss
>            Priority: Major
>
> The CLI returns a JSON output just when the CLI command got 'success'. In case of the output 'failed' the output is only DMR syntax.
> The following command was used in the tests: 
> JBOSS_HOME/bin/boss-cli.sh --connect --controller=localhost:9990 --command="/host=*/server=*/deployment=*/:read-resource(recursive=false,include-runtime=true)" --output-json



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list