I'm using python3-jenkins-job-builder-1.4.0-7.fc25.noarch.rpm on fedora and I can't update jobs. I can authenticate just fine with my password in the config ini file, but I get a 403 forbidden. I have tried this with both the python3 and python2 version. The below errors are from the python 2 version:
$ jenkins-jobs --conf jenkins_jobs.ini test project.yaml /usr/lib/python2.7/site-packages/jenkins/__init__.py:529: DeprecationWarning: get_plugins_info() is deprecated, use get_plugins() DeprecationWarning) Traceback (most recent call last): File "/guests/sharedfolder/code/github.com/projectatomic/adb-tests/cdrage-atomicapp-ci/centos-ci-jjb/foo/usr/bin/jenkins-jobs", line 10, in <module> sys.exit(main()) File "/usr/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 171, in main execute(options, config) File "/usr/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 337, in execute output=options.output_dir) File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 314, in update_job self.load_files(input_fn) File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 224, in load_files self.parser = YamlParser(self.global_config, self.plugins_list) File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 220, in plugins_list self._plugins_list = self.jenkins.get_plugins_info() File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 184, in get_plugins_info raise e jenkins.JenkinsException: Error in request. Possibly authentication failed [403]: Forbidden INFO:jenkins_jobs.builder:Cache saved
Note that if I run the "test" without the `--conf jenkins_jobs.ini`, the test passes as it is just validating the yaml.
I don't think this is an auth issue either because if I put the wrong password in the file then I get `Invalid password/token for user:` error.
Can someone confirm they can run jenkins_jobs to update a job? One way to do this is run through the `Your Next Job: Jenkins Job Builder` example I posted a long time ago:
http://dustymabe.com/2016/01/23/the-centos-ci-infrastructure-a-getting-start...
Thanks for any help! Dusty
Do you have this in your conf.ini file? query_plugins_info=False
On Fri, Apr 14, 2017 at 8:53 AM, Dusty Mabe dusty@dustymabe.com wrote:
I'm using python3-jenkins-job-builder-1.4.0-7.fc25.noarch.rpm on fedora and I can't update jobs. I can authenticate just fine with my password in the config ini file, but I get a 403 forbidden. I have tried this with both the python3 and python2 version. The below errors are from the python 2 version:
$ jenkins-jobs --conf jenkins_jobs.ini test project.yaml /usr/lib/python2.7/site-packages/jenkins/__init__.py:529: DeprecationWarning: get_plugins_info() is deprecated, use get_plugins() DeprecationWarning) Traceback (most recent call last): File "/guests/sharedfolder/code/github.com/projectatomic/adb- tests/cdrage-atomicapp-ci/centos-ci-jjb/foo/usr/bin/jenkins-jobs", line 10, in <module> sys.exit(main()) File "/usr/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 171, in main execute(options, config) File "/usr/lib/python2.7/site-packages/jenkins_jobs/cmd.py", line 337, in execute output=options.output_dir) File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 314, in update_job self.load_files(input_fn) File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 224, in load_files self.parser = YamlParser(self.global_config, self.plugins_list) File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 220, in plugins_list self._plugins_list = self.jenkins.get_plugins_info() File "/usr/lib/python2.7/site-packages/jenkins_jobs/builder.py", line 184, in get_plugins_info raise e jenkins.JenkinsException: Error in request. Possibly authentication failed [403]: Forbidden INFO:jenkins_jobs.builder:Cache saved
Note that if I run the "test" without the `--conf jenkins_jobs.ini`, the test passes as it is just validating the yaml.
I don't think this is an auth issue either because if I put the wrong password in the file then I get `Invalid password/token for user:` error.
Can someone confirm they can run jenkins_jobs to update a job? One way to do this is run through the `Your Next Job: Jenkins Job Builder` example I posted a long time ago:
http://dustymabe.com/2016/01/23/the-centos-ci-infrastructure-a-getting- started-guide/
Thanks for any help! Dusty _______________________________________________ Ci-users mailing list Ci-users@centos.org https://lists.centos.org/mailman/listinfo/ci-users
It is because querying plugins is not set for your user, I am not sure when that changed. I am glad that fixed it.
On Apr 14, 2017 9:03 AM, "Dusty Mabe" dusty@dustymabe.com wrote:
On 04/14/2017 08:57 AM, Ari LiVigni wrote:
Do you have this in your conf.ini file? query_plugins_info=False
Nope. and that seems to fix the problem. I haven't interfaced with jenkins in centos ci for a while. I guess that is a new requirement.
Thanks Ari,
Dusty
On Apr 14 09:06, Ari LiVigni wrote:
It is because querying plugins is not set for your user, I am not sure when that changed. I am glad that fixed it.
On Apr 14, 2017 9:03 AM, "Dusty Mabe" dusty@dustymabe.com wrote:
On 04/14/2017 08:57 AM, Ari LiVigni wrote:
Do you have this in your conf.ini file? query_plugins_info=False
Nope. and that seems to fix the problem. I haven't interfaced with jenkins in centos ci for a while. I guess that is a new requirement.
Thanks Ari,
Dusty
This was out to ci-users when we upgraded to Jenkins 2 (around August?).
I'm going to start a wiki page for JJB so we can document gotchas like this. If anyone has tips/tricks/links-to-templates etc. let me know and I'll give +RW
-- Brian