For Jenkins remote build trigger receiving the error HTTP 1.0, assume close after body HTTP/1.0 301 Moved Permanently

136 Views Asked by At

I am running the curl script to trigger the Jenkins parameterized Job but the job has not been trigger:

the following is the curl script am using to trigger Jenkins parameterized job :

passing the proper user name & api token

curl -v http://stg-selenium.ascendlearning.com/view/job/CRM_SmokeSuite_NASM/buildWithParameters --user bharat_jadhav:apitoken --data Environment=staging

getting the following error message:`

*   Trying 10.182.166.65:80...
* Connected to stg-selenium.xyzorg.com (10.182.166.65) port 80 (#0)

* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
      < HTTP/1.0 301 Moved Permanently
      < Location: https://stg-selenium.xyz.com/view/job/CRM_SmokeSuite_NASM/buildWithParameter

For the testing purpose I have created the one more own Jenkins instance. passing the proper user name & api token & this curl script is working fine and parameterized build has been triggered :

curl -v http://localhost:9090/job/remotejob/buildWithParameters --user bharat:112943793cc8e155130cd950c3adfa73aa --data env=stg

output of the working curl command

*   Trying 127.0.0.1:9090...
* Connected to localhost (127.0.0.1) port 9090 (#0)
* Server auth using Basic with user 'bharat'
< HTTP/1.1 201 Created

Can some one help me in troubleshooting this issue I have tried all the possible ways not getting the solution.

note: when I have googled error code 301 Moved Permanently is says to add the correct job url well in this case job is correct.

1

There are 1 best solutions below

0
SteveiGit On

301 Moved Permanently

Looks like your proxy (nginx or apache or some thing) is configured to use https and does redirect http to https.

So try curl https://stg-selenium.ascendlearning.com ...