-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Gerrit 3.2
The meta-ref of a change (e.g refs/changes/1/1/meta) might not be replicated with the same push as the patchset (e.g. refs/changes/1/1/1), but later. If Jenkins tries to clone from the Gerrit replica, Gerrit will try to check the users permission to read that revision and fails, because it requires the meta-ref to build the change notes. In the Gerrit logs this looks like:
org.eclipse.jgit.transport.UploadPackInternalServerErrorException at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:771) at com.google.gerrit.sshd.commands.Upload.runImpl(Upload.java:101) at com.google.gerrit.sshd.AbstractGitCommand.service(AbstractGitCommand.java:108) at com.google.gerrit.sshd.AbstractGitCommand.run(AbstractGitCommand.java:73) at com.google.gerrit.sshd.BaseCommand.run(BaseCommand.java:487) at com.google.gerrit.server.logging.LoggingContextAwareRunnable.run(LoggingContextAwareRunnable.java:110) at java.base/java.util.concurrent.Executors.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.run(ScheduledThreadPoolExecutor.java:304) at com.google.gerrit.server.git.WorkQueue.run(WorkQueue.java:610) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.io.IOException: at com.google.gerrit.server.git.PermissionAwareReadOnlyRefDatabase.getRefs(PermissionAwareReadOnlyRefDatabase.java:109) at com.google.gerrit.server.git.PermissionAwareReadOnlyRefDatabase.getRefsByPrefix(PermissionAwareReadOnlyRefDatabase.java:133) at org.eclipse.jgit.lib.RefDatabase.getRefsByPrefix(RefDatabase.java:436) at org.eclipse.jgit.transport.UploadPack.getFilteredRefs(UploadPack.java:892) at org.eclipse.jgit.transport.UploadPack.lsRefsV2(UploadPack.java:1093) at org.eclipse.jgit.transport.UploadPack.serveOneCommandV2(UploadPack.java:1274) at org.eclipse.jgit.transport.UploadPack.serviceV2(UploadPack.java:1318) at org.eclipse.jgit.transport.UploadPack.uploadWithExceptionPropagation(UploadPack.java:832) at org.eclipse.jgit.transport.UploadPack.upload(UploadPack.java:748) ... 12 more Caused by: com.google.gerrit.server.permissions.PermissionBackendException: can't construct change notes at com.google.gerrit.server.permissions.DefaultRefFilter.canSeeSingleChangeRef(DefaultRefFilter.java:486) at com.google.gerrit.server.permissions.DefaultRefFilter.filter(DefaultRefFilter.java:145) at com.google.gerrit.server.permissions.ProjectControl.filter(ProjectControl.java:425) at com.google.gerrit.server.git.PermissionAwareReadOnlyRefDatabase.getRefs(PermissionAwareReadOnlyRefDatabase.java:107) ... 20 more Caused by: com.google.gerrit.server.project.NoSuchChangeException: 1 at com.google.gerrit.server.notedb.ChangeNotes.onLoad(ChangeNotes.java:538) at com.google.gerrit.server.notedb.AbstractChangeNotes.load(AbstractChangeNotes.java:149) at com.google.gerrit.server.notedb.ChangeNotes.create(ChangeNotes.java:138) at com.google.gerrit.server.permissions.DefaultRefFilter.canSeeSingleChangeRef(DefaultRefFilter.java:484)
Thus, the gerrit-trigger plugin should ensure that both the patchset ref and meta-ref were replicated.