Jenkins can't find a job when building a job, why?

when running a command like

java -jar jenkins-cli.jar -s list-jobs --username admin --password 'admin'





but run

java -jar jenkins-cli.jar -s build testjob --username admin --password 'admin'

No such job 'testjob'


why doesn't it find "testjob"?


source to share

3 answers

I had the same behavior and found out that allowing anonymous read access in the global security section is fixed. You still need to specify --username

it --password

to access the resource.

allow anonymous read access



I tried exactly your command from my local jenkins and it works great. So I don't think there is anything wrong with your commands. I am trying to help, but I currently have no further idea.



For future searches only:

As described here :

If you are using an API token, which is the recommendation here, use the command below and it will work:

java -jar jenkins-cli.jar -s http://jenkins.example:8080/ -auth admin:2793b5e799cac2ec343245e2384f06fc build testing




All Articles