Problem triggering builds remotely

6,529 views
Skip to first unread message

Asfand Yar Qazi

unread,
Feb 17, 2016, 9:01:33 AM2/17/16
to Jenkins Users
Hi,

I am having trouble triggering builds remotely. I am using Jenkins 1.647.

(Please note: I have replaced sensitive info in the below examples with made-up values.)

I have a job where I have ticked the "Trigger builds remotely" box, and entered a token (for example: "123456").

I added a user 'remote-app-build' with an API token (for example: "apiapi").

Then, I try to trigger the build remotely with:

curl -X POST --data "token=123456" "http://remote-app-build:api...@54.194.XXX.XXX:8080/job/app-build/build"

I get the output:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 400 This page expects a form submission</title>
</head>
<body><h2>HTTP ERROR 400</h2>
<p>Problem accessing /job/app-build/build. Reason:
<pre>    This page expects a form submission</pre></p><hr /><i><small>Powered by Jetty://<
/small></i><br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 
<br/>                                                 

</body>
</html>
* Connection #0 to host 54.194.XXX.XXX left intact

As I said before, I have replaced sensitive info with made-up values.

Can you see what I am doing wrong?

Thanks

Victor Martinez

unread,
Feb 17, 2016, 4:40:55 PM2/17/16
to Jenkins Users
Correct me if I'm wrong but that job has any parameters? If so you will need to run another curl command:

You can also add some verbose output:        -v, --verbose

Cheers

Asfand Yar Qazi

unread,
Feb 18, 2016, 10:51:27 AM2/18/16
to jenkins...@googlegroups.com
Ah........ yes, thanks for pointing me in the right direction. I had
to do 'buildWithParameters' EVEN THOUGH all the parameters have
default values.

Thanks!
Regards,
Asfand Yar Qazi


On 17 February 2016 at 21:40, Victor Martinez
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/Q6gyKXITQwQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/1c1b7cc2-3a6b-4b94-9c59-a54d025ab08b%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages