Jenkins Gerrit轮询失败:不断触发构建

时间:2017-02-06 19:47:30

标签: jenkins repo gerrit-trigger

因此,我们在Jenkins CI构建管理器上使用Gerrit Trigger(2.23.0)&使用docker容器进行实际构建。

最近在我们的一些分支机构中出现的问题Gerrit Repo民意调查失败并导致其发现变化"每一次,所以尽管没有变化,它仍在不断重建。

检查Gerrit Repo轮询日志中是否有任何受影响的作业提供以下输出之一:

Started on Feb 1, 2017 3:12:25 PM
Polling SCM changes on aosp-host
[workspace] $ repo init -u http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git -b branch -m branch.xml
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
fatal: Not a git repository: '/home/jenkins/workspace/.repo/manifests.git'
fatal: Not a git repository: '/home/jenkins/workspace/.repo/manifests.git'
fatal: cannot obtain manifest http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git
Done. Took 1 min 19 sec
Changes found

或者,如果构建已经构建(gerrit waits for the build to finish before doing the scm poll

Started on Feb 2, 2017 3:24:15 AM
Polling SCM changes on aosp-host
[workspace] $ repo init -u http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git -b branch -m branch.xml
fatal: cannot make /home/jenkins/workspace/.repo/repo directory: File exists
Done. Took 2 hr 4 min
Changes found

由此失败触发的构建使用相同的命令并正常工作:

[workspace] $ repo init -u http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git -b branch -m branch.xml

导航到清单目录,我们看到症状:

jenkins@f052b3453d95:~/workspace/.repo$ ll 
total 32 
drwxr-xr-x 1 jenkins jenkins   180 Dec 20 11:08 ./ 
drwxrwxr-x 1 jenkins jenkins   778 Dec 20 11:07 ../
-rw-r--r-- 1 jenkins jenkins 20087 Dec 20 10:14 .repo_fetchtimes.json 
lrwxrwxrwx 1 jenkins jenkins    20 Dec 20 10:13 manifest.xml -> manifests/branch.xml 
drwxr-xr-x 1 jenkins jenkins     8 Dec 16 17:33 manifests/ 
drwxr-xr-x 1 jenkins jenkins    50 Dec 16 17:33 manifests.git/ 
drwxr-xr-x 1 jenkins jenkins    28 Dec 16 17:43 project-objects/
-rw-r--r-- 1 jenkins jenkins  7756 Dec 20 10:14 project.list 
drwxr-xr-x 1 jenkins jenkins   410 Dec 16 17:46 projects/

lrwxrwxrwx 1 jenkins jenkins    20 Dec 20 10:13 manifest.xml -> manifests/branch.xml

以红色突出显示,因为找不到关联的branch.xml ...因此上面的Gerrit日志准确无误,无法正确init。这是通过主目录中的repo status确认的:​​

jenkins@f052b3453d95:~/workspace$ repo status
Traceback (most recent call last):
  File "/home/jenkins/workspace/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/home/jenkins/workspace/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/home/jenkins/workspace/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/jenkins/workspace/.repo/repo/subcmds/status.py", line 130, in Execute
    all_projects = self.GetProjects(args)
  File "/home/jenkins/workspace/.repo/repo/command.py", line 140, in GetProjects
    all_projects_list = manifest.projects
  File "/home/jenkins/workspace/.repo/repo/manifest_xml.py", line 350, in projects
    self._Load()
  File "/home/jenkins/workspace/.repo/repo/manifest_xml.py", line 407, in _Load
    self.manifestProject.worktree))
  File "/home/jenkins/workspace/.repo/repo/manifest_xml.py", line 443, in _ParseManifestXml
    root = xml.dom.minidom.parse(path)
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
    return expatbuilder.parse(file)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 922, in parse
    fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: '/home/jenkins/workspace/.repo/manifest.xml'

问题是,通过命令行运行repo init -u <url> -m branch.xml工作正常,并生成有效的仓库。

可以为此问题提供任何见解?

0 个答案:

没有答案