Page MenuHomePhabricator

Unable to fix "This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset."
Closed, ResolvedPublic

Description

Gerrit and Jenkins seems to be behaving oddly recently, claiming that patch cannot be merged, or that it needs rebasing when it is actually up to date. Please see https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UniversalLanguageSelector/+/690494

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.

Same for https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UniversalLanguageSelector/+/693665

Similar but perhaps unrelated issue happened on https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseStatementUpdater/+/693578/1 where Gerrit's rebase dialog claimed that the change was already up to date with the master branch, when it was not. It did allow rebase though, creating PS2. For those ULS patches it does not.

Not sure if it is related, but I recently deleted and created a few branches for the ULS repository using the Gerrit interface. Could this have broken something?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
hashar triaged this task as Unbreak Now! priority.
hashar subscribed.

If developers workflow is broken and prevent work, that surely needs to be addressed on spot. The message comes from Zuul, it attempts to merge the proposed patch on top of current tip of the branch but otherwise doesn't give any meaningful message when that fails. One has to dig into the logs, they can be found on contint1001 / contint2001 under /var/log/zuul/merger-debug.log.

And I get:

2021-05-26 07:40:48,865 DEBUG zuul.Merger: Merging for change 690494,4.
2021-05-26 07:40:48,865 DEBUG zuul.Merger: Processing refspec refs/changes/94/690494/4 for project mediawiki/extensions/UniversalLanguageSelector / master ref Z287e7977433c484fa716ea693d4d95e0
2021-05-26 07:40:48,911 DEBUG zuul.Merger: Unable to find commit for ref master/Z287e7977433c484fa716ea693d4d95e0
2021-05-26 07:40:48,911 DEBUG zuul.Merger: No base commit found for (u'mediawiki/extensions/UniversalLanguageSelector', u'master')
2021-05-26 07:40:48,911 DEBUG zuul.Repo: Resetting repository /srv/zuul/git/mediawiki/extensions/UniversalLanguageSelector
2021-05-26 07:40:48,912 DEBUG zuul.Repo: Updating repository /srv/zuul/git/mediawiki/extensions/UniversalLanguageSelector
2021-05-26 07:40:49,788 ERROR zuul.Merger: Unable to reset repo <zuul.merger.merger.Repo object at 0x7ff361782d10>
Traceback (most recent call last):
  File "/srv/deployment/zuul/venv/local/lib/python2.7/site-packages/zuul/merger/merger.py", line 326, in _mergeItem
    repo.reset()
  File "/srv/deployment/zuul/venv/local/lib/python2.7/site-packages/zuul/merger/merger.py", line 101, in reset
    self.update()
  File "/srv/deployment/zuul/venv/local/lib/python2.7/site-packages/zuul/merger/merger.py", line 207, in update
    origin.fetch(tags=True, force=True)
  File "/srv/deployment/zuul/venv/local/lib/python2.7/site-packages/git/remote.py", line 789, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress)
  File "/srv/deployment/zuul/venv/local/lib/python2.7/site-packages/git/remote.py", line 675, in _get_fetch_info_from_stderr
    proc.wait(stderr=stderr_text)
  File "/srv/deployment/zuul/venv/local/lib/python2.7/site-packages/git/cmd.py", line 415, in wait
    raise GitCommandError(self.args, status, errstr)
GitCommandError: Cmd('git') failed due to: exit code(1)
  cmdline: git fetch --force --tags -v origin
  stderr: 'error: cannot lock ref 'refs/remotes/origin/mleb': 'refs/remotes/origin/mleb/2021.05' exists; cannot create 'refs/remotes/origin/mleb'
 ! [new branch]        mleb              -> origin/mleb  (unable to update local ref)
 = [up to date]        wmf/1.35.0-wmf.1  -> origin/wmf/1.35.0-wmf.1
 = [up to date]        wmf/1.35.0-wmf.10 -> origin/wmf/1.35.0-wmf.10
 = [up to date]        wmf/1.35.0-wmf.11 -> origin/wmf/1.35.0-wmf.11
 = [up to date]        wmf/1.35.0-wmf.14 -> origin/wmf/1.35.0-wmf.14
 = [up to date]        wmf/1.35.0-wmf.15 -> origin/wmf/1.35.0-wmf.15
 = [up to date]        wmf/1.35.0-wmf.16 -> origin/wmf/1.35.0-wmf.16
 = [up to date]        wmf/1.35.0-wmf.18 -> origin/wmf/1.35.0-wmf.18
 = [up to date]        wmf/1.35.0-wmf.19 -> origin/wmf/1.35.0-wmf.19
 = [up to date]        wmf/1.35.0-wmf.2  -> origin/wmf/1.35.0-wmf.2
 = [up to date]        wmf/1.35.0-wmf.20 -> origin/wmf/1.35.0-wmf.20
 = [up to date]        wmf/1.35.0-wmf.21 -> origin/wmf/1.35.0-wmf.21
 = [up to date]        wmf/1.35.0-wmf.22 -> origin/wmf/1.35.0-wmf.22
 = [up to date]        wmf/1.35.0-wmf.23 -> origin/wmf/1.35.0-wmf.23
 = [up to date]        wmf/1.35.0-wmf.24 -> origin/wmf/1.35.0-wmf.24
 = [up to date]        wmf/1.35.0-wmf.25 -> origin/wmf/1.35.0-wmf.25
 = [up to date]        wmf/1.35.0-wmf.26 -> origin/wmf/1.35.0-wmf.26
 = [up to date]        wmf/1.35.0-wmf.27 -> origin/wmf/1.35.0-wmf.27
 = [up to date]        wmf/1.35.0-wmf.28 -> origin/wmf/1.35.0-wmf.28
 = [up to date]        wmf/1.35.0-wmf.3  -> origin/wmf/1.35.0-wmf.3
 = [up to date]        wmf/1.35.0-wmf.30 -> origin/wmf/1.35.0-wmf.30
 = [up to date]        wmf/1.35.0-wmf.31 -> origin/wmf/1.35.0-wmf.31
 = [up to date]        wmf/1.35.0-wmf.32 -> origin/wmf/1.35.0-wmf.32
 = [up to date]        wmf/1.35.0-wmf.34 -> origin/wmf/1.35.0-wmf.34
 = [up to date]        wmf/1.35.0-wmf.35 -> origin/wmf/1.35.0-wmf.35
 = [up to date]        wmf/1.35.0-wmf.36 -> origin/wmf/1.35.0-wmf.36
 = [up to date]        wmf/1.35.0-wmf.37 -> origin/wmf/1.35.0-wmf.37
 = [up to date]        wmf/1.35.0-wmf.38 -> origin/wmf/1.35.0-wmf.38
 = [up to date]        wmf/1.35.0-wmf.39 -> origin/wmf/1.35.0-wmf.39
 = [up to date]        wmf/1.35.0-wmf.4  -> origin/wmf/1.35.0-wmf.4
 = [up to date]        wmf/1.35.0-wmf.40 -> origin/wmf/1.35.0-wmf.40
 = [up to date]        wmf/1.35.0-wmf.41 -> origin/wmf/1.35.0-wmf.41
 = [up to date]        wmf/1.35.0-wmf.5  -> origin/wmf/1.35.0-wmf.5
 = [up to date]        wmf/1.35.0-wmf.8  -> origin/wmf/1.35.0-wmf.8
 = [up to date]        wmf/1.36.0-wmf.1  -> origin/wmf/1.36.0-wmf.1
 = [up to date]        wmf/1.36.0-wmf.10 -> origin/wmf/1.36.0-wmf.10
 = [up to date]        wmf/1.36.0-wmf.11 -> origin/wmf/1.36.0-wmf.11
 = [up to date]        wmf/1.36.0-wmf.12 -> origin/wmf/1.36.0-wmf.12
 = [up to date]        wmf/1.36.0-wmf.13 -> origin/wmf/1.36.0-wmf.13
 = [up to date]        wmf/1.36.0-wmf.14 -> origin/wmf/1.36.0-wmf.14
 = [up to date]        wmf/1.36.0-wmf.15 -> origin/wmf/1.36.0-wmf.15
 = [up to date]        wmf/1.36.0-wmf.16 -> origin/wmf/1.36.0-wmf.16
 = [up to date]        wmf/1.36.0-wmf.17 -> origin/wmf/1.36.0-wmf.17
 = [up to date]        wmf/1.36.0-wmf.18 -> origin/wmf/1.36.0-wmf.18
 = [up to date]        wmf/1.36.0-wmf.19 -> origin/wmf/1.36.0-wmf.19
 = [up to date]        wmf/1.36.0-wmf.2  -> origin/wmf/1.36.0-wmf.2
 = [up to date]        wmf/1.36.0-wmf.20 -> origin/wmf/1.36.0-wmf.20
 = [up to date]        wmf/1.36.0-wmf.21 -> origin/wmf/1.36.0-wmf.21
 = [up to date]        wmf/1.36.0-wmf.22 -> origin/wmf/1.36.0-wmf.22
 = [up to date]        wmf/1.36.0-wmf.23 -> origin/wmf/1.36.0-wmf.23
 = [up to date]        wmf/1.36.0-wmf.24 -> origin/wmf/1.36.0-wmf.24
 = [up to date]        wmf/1.36.0-wmf.25 -> origin/wmf/1.36.0-wmf.25
 = [up to date]        wmf/1.36.0-wmf.26 -> origin/wmf/1.36.0-wmf.26
 = [up to date]        wmf/1.36.0-wmf.27 -> origin/wmf/1.36.0-wmf.27
 = [up to date]        wmf/1.36.0-wmf.28 -> origin/wmf/1.36.0-wmf.28
 = [up to date]        wmf/1.36.0-wmf.29 -> origin/wmf/1.36.0-wmf.29
 = [up to date]        wmf/1.36.0-wmf.3  -> origin/wmf/1.36.0-wmf.3
 = [up to date]        wmf/1.36.0-wmf.30 -> origin/wmf/1.36.0-wmf.30
 = [up to date]        wmf/1.36.0-wmf.31 -> origin/wmf/1.36.0-wmf.31
 = [up to date]        wmf/1.36.0-wmf.32 -> origin/wmf/1.36.0-wmf.32
 = [up to date]        wmf/1.36.0-wmf.33 -> origin/wmf/1.36.0-wmf.33
 = [up to date]        wmf/1.36.0-wmf.34 -> origin/wmf/1.36.0-wmf.34
 = [up to date]        wmf/1.36.0-wmf.35 -> origin/wmf/1.36.0-wmf.35
 = [up to date]        wmf/1.36.0-wmf.36 -> origin/wmf/1.36.0-wmf.36
 = [up to date]        wmf/1.36.0-wmf.37 -> origin/wmf/1.36.0-wmf.37
 = [up to date]        wmf/1.36.0-wmf.38 -> origin/wmf/1.36.0-wmf.38
 = [up to date]        wmf/1.36.0-wmf.4  -> origin/wmf/1.36.0-wmf.4
 = [up to date]        wmf/1.36.0-wmf.5  -> origin/wmf/1.36.0-wmf.5
 = [up to date]        wmf/1.36.0-wmf.6  -> origin/wmf/1.36.0-wmf.6
 = [up to date]        wmf/1.36.0-wmf.7  -> origin/wmf/1.36.0-wmf.7
 = [up to date]        wmf/1.36.0-wmf.8  -> origin/wmf/1.36.0-wmf.8
 = [up to date]        wmf/1.36.0-wmf.9  -> origin/wmf/1.36.0-wmf.9
 = [up to date]        wmf/1.37.0-wmf.1  -> origin/wmf/1.37.0-wmf.1
 = [up to date]        wmf/1.37.0-wmf.2  -> origin/wmf/1.37.0-wmf.2
 = [up to date]        wmf/1.37.0-wmf.3  -> origin/wmf/1.37.0-wmf.3
 = [up to date]        wmf/1.37.0-wmf.4  -> origin/wmf/1.37.0-wmf.4
 = [up to date]        wmf/1.37.0-wmf.5  -> origin/wmf/1.37.0-wmf.5
 = [up to date]        wmf/1.37.0-wmf.6  -> origin/wmf/1.37.0-wmf.6
 = [up to date]        wmf/1.37.0-wmf.7  -> origin/wmf/1.37.0-wmf.7
--
 cmdline: git fetch --force --tags -v origin
 stderr: 'error: cannot lock ref 'refs/remotes/origin/mleb': 'refs/remotes/origin/mleb/2021.05' exists; cannot create 'refs/remotes/origin/mleb'
! [new branch]        mleb              -> origin/mleb  (unable to update local ref)

So what happens is that there was a mleb/2021.05 branch which on the disk is represented by:

.git/refs/remotes/origin/mleb
└── 2021.05

That branch got deleted/renamed to mleb and git tries to create a file .git/refs/remotes/origin/mleb which conflicts with the already existing directory having the same name. I don't know why Zuul does not prune the remote branch first (which would discard the mleb/2021.05 and thus drop the mleb directory, so I just ran it manually:

contint2001$ sudo -u zuul git -C /srv/zuul/git/mediawiki/extensions/UniversalLanguageSelector remote prune origin
RSA host key for IP address '2620:0:861:2:208:80:154:137' not in list of known hosts.
Pruning origin
URL: ssh://jenkins-bot@gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector
 * [pruned] origin/jqueryime
 * [pruned] origin/mleb/2021.05
 * [pruned] origin/webfonts_library
 * [pruned] origin/wmf/1.36.0-wmf.39
contint1001$ sudo -u zuul git -C /srv/zuul/git/mediawiki/extensions/UniversalLanguageSelector remote prune origin
RSA host key for IP address '2620:0:861:2:208:80:154:137' not in list of known hosts.
Pruning origin
URL: ssh://jenkins-bot@gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector
 * [pruned] origin/jqueryime
 * [pruned] origin/webfonts_library
 * [pruned] origin/wmf/1.36.0-wmf.39

Similar but perhaps unrelated issue happened on https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseStatementUpdater/+/693578/1 where Gerrit's rebase dialog claimed that the change was already up to date with the master branch, when it was not. It did allow rebase though, creating PS2.

That might be some lag to compute whether a change can be merged against the branch. It happens asynchronously and might be slightly delayed when under heavy load. Regardless if it showed the rebase button, it means the change was not up to date inside Gerrit maybe.