[OpenStack-Infra] Jenkins Jobs authentication failed

Antoine Musso hashar at free.fr
Mon Feb 24 09:56:55 UTC 2014


Le 20/02/2014 07:19, trinath.somanchi at freescale.com a écrit :
> Hi-
> 
> while setting up the Jenkins Jobs, I got this error
> 
> root at openstack-ci:~# sudo jenkins-jobs --flush-cache update 
> /etc/jenkins_jobs/config/
> INFO:root:Updating jobs in /etc/jenkins_jobs/config/ ([])
<snip>
> line 218, in jenkins_open
>     'Possibly authentication failed [%s]' % (e.code)
> jenkins.JenkinsException: Error in request.Possibly authentication
> failed [401]

Hello Trinath,

Not sure you should run the script as root, but I am digressing.

One of my coworker could not authenticate properly and we found out the
username needs to be all lower case.  Ie in jenkins_jobs.ini :

 [jenkins]
 user=trinath
 password=123456890abcdef

Make sure you are using your username API token, not the regular
password.  You can find it from the Jenkins web interface under:

 <you jenkins url>/ci/user/<your username>/configure

Under the section "API token", press the button [Show API token..]


Then you can try authentication manually from python interactive command:

 >>> import jenkins
 >>> j = jenkins.Jenkins( '<jenkins url>/ci', username='trinath',
password='<your API token there'>
 >>> j.get_queue_info()

Should give you something (aka not a 401).


-- 
Antoine "hashar" Musso



More information about the OpenStack-Infra mailing list