Jenkins Job Builder不工作:jenkins-jobs update jobs/

vjrehmav  于 2023-06-28  发布在  Jenkins
关注(0)|答案(1)|浏览(187)

jenkins-jobs update jobs/

错误

INFO:jenkins_jobs. cli. subcommand. base:正在更新[PosixPath('/home/ishu/jobs')]([])中的作业INFO:root:Caching type builders of builders = jenkins_www.example.com:Builders INFO:jenkins_jobs. builder:生成的作业数:jobs.modules.builders文件"/usr/local/lib/python3.10/dist-packages/jenkins/init. py ",第822行,在get_info中返回json。负载(self. jenkins_open(File "/usr/local/lib/python3.10/dist-packages/jenkins/init. py”,第560行,在jenkins_open return self中。jenkins_request(req,add_crumb,resolve_auth). text文件"/usr/local/lib/python3.10/dist-packages/jenkins/init。py”,第576行,在jenkins_request self中。maybe_add_crumb(req)文件"/usr/local/lib/python3.10/dist-packages/jenkins/init。py”,第373行,在maybe_add_crumb response = self中。jenkins_open(requests.请求(文件"/usr/local/lib/python3.10/dist-packages/jenkins/init. py”,第560行,在jenkins_open return self中。jenkins_request(req,add_crumb,resolve_auth). text文件"/usr/local/lib/python3.10/dist-packages/jenkins/init。py”,第579行,在jenkins_request self中。_request(req))文件"/usr/local/lib/python3.10/dist-packages/jenkins/init. py",第553行,in_request返回self。_session。send(r,_settings)文件"/usr/local/lib/python3.10/dist-packages/requests/sessions. py”,第701行,在send r = adapter中。send(request,kwargs)文件"/usr/local/lib/python3.10/dist-packages/requests/adapters. py",line 483,in send timeout = TimeoutSauce(connect = timeout,read = timeout)File "/usr/local/lib/python3.10/dist-packages/urllib3/util/timeout. py”,第119行,在initself中。_connect = self。_validate_timeout(connect," connect")文件"/usr/local/lib/python3.10/dist-packages/urllib3/util/timeout. py",第156行,in_validate_timeout raise ValueError(ValueError:超时值connect为,但必须为int、float或None。<object object at 0x7fece1460800>
在处理上述异常的过程中,又出现了一个异常:
追溯(最近一次调用):文件"/home/ishu/. local/bin/jenkins-jobs ",第8行,在sys. exit(main())File "/home/ishu/. local/lib/python3.10/site-packages/jenkins_jobs/cli/entry. py”,第179行,在main jjb中。execute()File "/home/ishu/. local/lib/python3.10/site-packages/jenkins_jobs/cli/entry. py”,第158行,在execute ext.目标execute(self.选项,self。jjb_config)文件"/home/ishu/。local/lib/python3.10/site-packages/jenkins_jobs/cli/subcommand/update. py",第133行,在execute jobs中,num_updated_jobs = builder。update_jobs(File "/home/ishu/. local/lib/python3.10/site-packages/jenkins_jobs/builder. py ",第332行,在update_jobs results = self中。parallel_update_job(n_workers = n_workers,concurrent = p_params)文件"/home/ishu/。local/lib/python3.10/site-packages/jenkins_jobs/parallel。py",第113行,在并发返回func(* args,**kwargs)文件"/home/ishu/中。local/lib/python3.10/site-packages/jenkins_jobs/builder. py”,第353行,在parallel_update_job self中。update_job(job.name,job. output(). decode(" utf-8"))文件"/home/ishu/. local/lib/python3.10/site-packages/jenkins_jobs/builder。py",第132行,在update_job中,如果 www.example.com 文件"/home/ishu/. local/lib/python3.10/site-packages/jenkins_jobs/builder。py ",第102行,在job_list self中。_job_list = set(job [" fullname "] for job in www.example.com)File "/home/ishu/. local/lib/python3.10/site-packages/jenkins_jobs/builder。py",第94行,在jobs self。_jobs = self。Jenkins。get_all_jobs()文件"/usr/local/lib/python3.10/dist-packages/jenkins/init。py ",第1074行,在get_all_jobs jobs =[(0,[],self. get_info(query = jobs_query)['jobs '])]文件"/usr/local/lib/python3.10/dist-packages/jenkins/init. py",line 829,in get_info raise JenkinsException(" Could not parse JSON info for server [ % s]" jenkins. JenkinsException:无法解析服务器的JSON信息[http://localhost:9090/]

raise JenkinsException("Could not parse JSON info for server[%s]"

jenkins.JenkinsException:无法解析服务器的JSON信息[http://localhost:9090/]

xeufq47z

xeufq47z1#

这是由 urllib3 库中的一个bug引起的:https://bugs.launchpad.net/python-jenkins/+bug/2018567有几种解决方案可以解决这个问题,但最直接的一种是在配置文件中添加(例如:jenkins_jobs.initimeout 属性,在**[jenkins]**部分,如下所示:

[...]

[jenkins]
user=youruser
password=yourpassword
url=http://localhost:9090/
timeout=60
query_plugins_info=False
##### This is deprecated, use job_builder section instead
#ignore_cache=True

[...]

目前,这在Python 3.11.4(我正在使用)中仍然是可复制的,所以希望在合并补丁https://review.opendev.org/c/jjb/python-jenkins/+/882757后,这个问题会得到修复。

相关问题