Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hudson trigger builds remotely gives a forbidden 403 error

I have a shell script on the same machine that hudson is deployed on and upon executing it, it calls wget on a hudson build trigger URL. Since its the same machine, I access it as http://localhost:8080/hudson/job/jobname/build?token=sometoken

Typically, this is supposed to trigger a build on the project. But I get a 403 forbidden when I do this. Anybody has any idea why? I have tried this using a browser and it triggers the build, but via the command line it doesn't seem to work. Any ideas?

like image 523
Ritesh M Nayak Avatar asked Apr 06 '10 05:04

Ritesh M Nayak


1 Answers

I figured it out. Apparently if Hudson is protected using a security mechanism, you need to authenticate the build requests. See this wiki link for more details http://wiki.hudson-ci.org/display/HUDSON/Authenticating+scripted+clients

Since I used the auth mechanism that was shipped with Hudson, calling the build scripts invovled. I used

wget --auth-no-challenge --http-user=user --http-password=password http://hudson.yourcompany.com/job/your_job/build?token=TOKEN

to run the build script.

like image 155
Ritesh M Nayak Avatar answered Oct 27 '22 00:10

Ritesh M Nayak