Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins-cli build on Cloudbees: "no such job"

I need to remotely trigger a Jenkins build hosted on CloudBees. Right now, I'm attempting to use jenkins-cli to no avail. Right now I am authenticating using a SSH key pair.

When I do:

$ java -jar jenkins-cli.jar -s https://... list-jobs All

I can see all the jobs, including the one I want to build. But when I do:

$ java -jar jenkins-cli.jar -s https://... build job1
No such job 'job1'

I've read about a workaround that involves adding permissions to the anonymous role. Even if I add every single permission to it, I get the same error.

If it helps, I'm using Jenkins 1.532.1.3. Thanks.

like image 577
Rodrigo López Dato Avatar asked Feb 06 '14 17:02

Rodrigo López Dato


1 Answers

Today I ran into same problem and found the solution. The response 'no such job' comes when there is actually no such job or you don't have enough access to do requested operation. Even when you have the access for requested operation and you are sending credentials with --username and --password arguments it still not works. Only solution I found was to use ssh authentication. So register your computer's ssh key to your jenkins and everything works fine. To register ssh key go to http://[yourjenkinsserver]/user/[username]/configure

like image 50
Pramod Jangam Avatar answered Oct 19 '22 14:10

Pramod Jangam