Jenkins Gerrit poll fails: builds constantly running

So, we use Gerrit Trigger (2.23.0) in our Jenkins CI build manager and use docker containers for real builds.

A problem that recently appeared in some of our branches, the Gerrit Repo poll fails and forces it to "detect changes" every time, so it is constantly being restored, despite the absence of changes.

Checking the Gerrit Repo polling log for any of the affected jobs gives one of the following outputs:

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 

or if the assembly has already been built ( gerrit waits for the assembly to complete before scm polling )

 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 

The failures caused by this failure use the same commands and work fine:

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

Turning to the manifest directory, we see a symptom:

 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/ 

with

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

highlighted in red because the branch.xml associated with it branch.xml not found ... therefore the Gerrit log above is accurate, it does not match init correctly. This is confirmed using repo status in the main directory:

 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' 

The problem is that running repo init -u <url> -m branch.xml through the command line works fine and creates a valid repo.

Can this problem be clarified?

+5
source share

Source: https://habr.com/ru/post/1263892/


All Articles