Job log retrieval through the web service returns HTTP 500 (versions 5.2.0 to 5.2.2)
On RapidDeploy 5.2.0, 5.2.1 and 5.2.2 the web-service call that returns a job log fails for every job with an HTTP 500 internal error instead of returning the log:
GET /MidVision/ws/deployment/showlog/job/{id}
Because the rd command-line client uses this call to fetch job logs, rd cannot retrieve a job log on those versions either.
This is fixed in 5.2.4.
What is not affected
The failure is confined to that one web-service call. In particular:
- the deployment job itself runs normally, and its log is written to disk correctly - no job output is lost;
- viewing the job log in the web interface works normally;
- no other web-service endpoint is affected.
Cause
The endpoint handed the log to the servlet layer as a raw input stream. That is a form for which there has been no writer since the REST tier moved from JAX-RS to Spring MVC in 5.2.0, so the response could never be produced. The error is unrelated to authentication, to permissions, or to the job being requested; it occurs for every valid job id and for every value of the Accept request header.
Workaround without upgrading
Retrieve the same log through the streamer download endpoint, which returns identical content and takes the same Authorization header:
GET /MidVision/ws/streamer/job/log/{id}
This endpoint requires authentication and authorisation for the job in question, in common with the other streamer downloads.
Resolution
Upgrade to RapidDeploy 5.2.4 or later, where /ws/deployment/showlog/job/id returns the job log as expected. The log is streamed rather than held in memory, so large job logs are returned without additional memory cost on the server.
