-
Bug
-
Resolution: Unresolved
-
Minor
-
dev
The Rundeck plugin is configured with user/pass and a token under Configure System. The test connection works and the api user has access to all Rundeck jobs.
In the Project under Post Build, I have configured Rundeck to the run the job with Jenkins variables for $BUILD_NUMBER and $JOB_NAME. The call to Rundeck fails with this:
Notifying Rundeck...
Error while talking to Rundeck's API at http://10.162.0.10:4440 : Invalid HTTP response 'HTTP/1.1 405 Method Not Allowed' for http://10.162.0.10:4440/api/17/job/1a5f402e-eb4b-4fd3-8528-73200e19c0ea/run?argString=-BuildNumber+19+-Client+clientname
Build step 'Rundeck' marked build as failure
Using curl from the same server, the API with the token works perfectly.
curl -H "X-RunDeck-Auth-Token: ka93qMLHn4RKR0csQEp8GEbhLnotreal" --data-urlencode "argString=-BuildNumber 20 -Client clientname" http://10.162.0.10:4440/api/17/job/1a5f402e-eb4b-4fd3-8528-73200e19c0ea/run
It looks like the Rundeck plugin is not using the token or is going a GET instead of a POST.
Hi,
I'm facing the same issue here. I'm using Jenkins v2.19.2 and Rundeck Plugin v3.5.4
I can confirm that the plugin uses a GET instead of a POST and that's why it's failing hence the 405 error. The token is correctly used though. As stated in Rundeck API documentation, GET method is no longer supported to trigger a job run since API version 14 (version 18 is the current API version). POST method is now required:
I'm surprised that this bug is only tagged as "minor" since the plugin simply does not work with recent versions of Rundeck. Workarounds using curl induce a significant amount of work to not only trigger a job but also follow job executions (polling regularly, etc...)
Any feedback on this issue ?
Regards,