Description of problem: Create an app which supports threaddump. Make the app into idle status. Then try to threaddump the app. It will return nothing. Version-Release number of selected component (if applicable): rhc-1.11.3 devenv_3471 How reproducible: always Steps to Reproduce: 1.Create jboss app rhc app create jboss1 jbossas-7 2.Idle the app oo-admin-ctl-gears idlegear <uuid> 3.Threaddump the app rhc threaddump jboss1 Actual results: There is nothing in the output Expected results: Should tell user that the app is in idle status. Additional info: There is such info when threaddump a stopped app. $rhc threaddump juvia RESULT: juvia stopped And can get the following info when using rest api. <message> <severity>error</severity> <text>Application is idle, must be started to allow a thread dump</text> <exit-code>0</exit-code> <field nil="true"></field> </message>
This is a broker bug - severity "error" should not be returned when a 200 is returned. Instead, if there is truly an error, it should be communicated via the HTTP status code ALONG with the error message. There should never be a message with severity "error" on a request that returns 200. See the email sent around about client_error and client_result.
Clayton, 1. One option is to return a status 409 described below. The problem with this options is that the broker cannot tell the difference between this type of error and a server error based on the response from the node "409 Conflict The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough information for the user to recognize the source of the conflict. Ideally, the response entity would include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required. " 2. Another option is to change the code on node to returns this as a CLIENT_MESSAGE which then will be classified as a warning and will be displayed to users regardless of the HTTP status code, right? I like option 2 better because then all other errors can be classified as 500 (which is not in place today and should be added as part of this bug fix)
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/b3a83f3a185588f82fc5aa917e452a0107da3dc4 Bug 982921
https://github.com/openshift/origin-server/pull/3174
Checked on devenv_3564, the result is still incorrect. <severity>error</severity> <text>Unable to complete the requested operation due to: undefined method `exit_code' for #<ResultIO:0x00000005d538d8>. Reference ID: 826de9c59bcb8a16c446439640200b3c</text> <exit-code>1</exit-code> <field nil="true"></field>
https://github.com/openshift/origin-server/pull/3183
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/63dc96b068254aa29bd85c9335f37bef2cbbff09 Bug 982921
If the application is idled, a thread dump is technically not possible - so it's an error or a failure, not a 200. But it seems like your changes are consistent so far.
Tested on devenv_3898, the error message returned is correct, but the exit code should not be 0. <messages> <message> <severity>error</severity> <text>Error occured while processing event 'thread-dump':Application is idle, must be started to allow a thread dump</text> <exit-code>0</exit-code> <field nil="true"></field> <index nil="true"></index> </message> </messages>
Assigning to runtime team exitcode returned from node is zero.
Commits pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/17e57b2d3e59022f7a3e4fc3924e6604f9c25a3d Bug 982921 https://github.com/openshift/origin-server/commit/7f19cdf2f423115de30c519f4d338098dd8048b6 Merge pull request #4536 from danmcp/bug982921 Merged by openshift-bot
It's fixed, verified on devenv_4270, please refer to the following results: 1.Create jboss app rhc app create jboss1 jbossas-7 2.Idle the app oo-admin-ctl-gears idlegear <uuid> 3.Threaddump the app # rhc threaddump jboss1 Error occured while processing event 'thread-dump': Application is idle, must be started to allow a thread dump # echo $? 1 By rest api: <messages> <message> <severity>error</severity> <text>Error occured while processing event 'thread-dump': Application is idle, must be started to allow a thread dump</text> <exit-code>1</exit-code> <field nil="true"></field> <index nil="true"></index> </message> </messages>