Description of problem: If creating a new resource using REST API REST api is waiting for resource to get created by agent (or it redirects client, to poll for result). If it succeeds Version-Release number of selected component (if applicable): JON 3.2.ER4 How reproducible: always Steps to Reproduce: 1. have AS7 Standalone in inventory 2. run sample https://github.com/rhq-project/samples/blob/master/rest-api/python/create_as7_deployment.py twice Actual results: on the 2nd run you get non-JSON response, but server resports content-type as application/json (sample will not print it, though) Expected results: server must return valid response with error message in JSON format. I'd suggest changing endpoint GET /resource/creationStatus/{id} to include status information in every case. Additional info:
Marked as blocker, as the suggestion is to change the endpoint (API) this would not be welcomed in a fix post-GA. (Solution could be elsewhere though)
Ok, nm the output There are two issues here: 1) the endpoint indeed did not wrap the response correctly 2) the script does not honor http response codes and would have seen that this is an error by the 500 return code 1) is fixed in master 64286484fc release branch 6bb68f530d
2) should be fixed in https://github.com/rhq-project/samples/pull/11 I have to apologize for not checking response code. I didn't check it because I consider state "cannot create resource" not as a server error (denoted by status code 500) but as possibly expected state. Now, after reading RFC, there's probably not a better response code for this situation.
Moving this to ON_QA, as discussed in triage call (myarboro,loleary,spinder). This is already in the GA tag but somehow we didn't set this to ON_QA.
verified on 3.2.0.GA