TeamCity 2026.1.3: Git labeling fails with src refspec does not match any after merge

Hi,

I recently saw, that TeamCity cannot label my commits after a merge. I always get the following error in the web panel:

Failed to set label 'label-name': refs/tags/label-name cannot be resolved to branch Full error: git -c credential.helper= -c credential.helper=/opt/TeamCity/temp/credHelper*.sh push git@bitbucket.org:project/repo

 

Then I started looking into the logs of the Server and saw this:

[2026-08-13 10:44:10,698]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 2 VCS root instances where periodical checking for changes is required
[2026-08-13 10:44:20,714]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 15 VCS root instances where periodical checking for changes is required
[2026-08-13 10:44:30,718]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 4 VCS root instances where periodical checking for changes is required
[2026-08-13 10:44:50,789]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 14 VCS root instances where periodical checking for changes is required
[2026-08-13 10:44:57,995]   INFO [mal executor 12] - iggers.vcs.git.GitMergeSupport - Merge in root "project_master" {instance id=3, parent internal id=1, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}, revision x, destination refs/heads/master
[2026-08-13 10:44:58,005]   INFO [prio executor 3] -      jetbrains.buildServer.VCS - Labeling VCS root "project_master" {instance id=3, parent internal id=1, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}@x for build #1.0.1 {build id=16918, buildTypeId=Project_ReleaseCandidate}
[2026-08-13 10:44:59,481]   WARN [prio executor 3] -      jetbrains.buildServer.VCS - Failed to run operation within 1 attempt: jetbrains.buildServer.vcs.VcsException: git -c credential.helper= -c credential.helper=/opt/TeamCity/temp/credHelper*.sh push git@bitbucket.org:project/repo 1.0.1 command failed.
exit code: 1
stderr: error: src refspec 1.0.1 does not match any
error: failed to push some refs to 'bitbucket.org:project/repo' (enable debug to see stacktrace)
[2026-08-13 10:44:59,506]   WARN [prio executor 3] -      jetbrains.buildServer.VCS - Failed to delete local tag 1.0.1 of x after unssuccessful push for "project_master" {instance id=3, parent internal id=1, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}
jetbrains.buildServer.vcs.VcsException: git tag -d 1.0.1 command failed.
exit code: 1
stderr: error: tag '1.0.1' not found.
        at jetbrains.buildServer.buildTriggers.vcs.git.command.impl.CommandUtil.commandFailed(CommandUtil.java:76)
        at jetbrains.buildServer.buildTriggers.vcs.git.command.impl.CommandUtil.checkCommandFailed(CommandUtil.java:41)
        at jetbrains.buildServer.buildTriggers.vcs.git.command.impl.CommandUtil.runCommand(CommandUtil.java:139)
        at jetbrains.buildServer.buildTriggers.vcs.git.command.impl.CommandUtil.runCommand(CommandUtil.java:113)
        at jetbrains.buildServer.buildTriggers.vcs.git.command.impl.TagCommandImpl.call(TagCommandImpl.java:99)
        at jetbrains.buildServer.buildTriggers.vcs.git.command.NativeGitCommands.tag(NativeGitCommands.java:514)
        at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport$1.lambda$label$0(GitVcsSupport.java:392)
        at jetbrains.buildServer.buildTriggers.vcs.git.RepositoryManagerImpl.runWithDisabledRemove(RepositoryManagerImpl.java:254)
        at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport$1.label(GitVcsSupport.java:391)
        at jetbrains.vcs.api.services.impl.LabelingServiceProvider$1.label(LabelingServiceProvider.java:1)
        at jetbrains.buildServer.vcs.impl.VcsLabeler.lambda$doSetLabel$5(VcsLabeler.java:30)
        at jetbrains.buildServer.serverSide.impl.BaseAccessChecker.runWithDisabledChecks(BaseAccessChecker.java:4)
        at jetbrains.buildServer.serverSide.impl.SecondaryNodeSecurityManager.executeSafe(SecondaryNodeSecurityManager.java:22)
        at jetbrains.buildServer.serverSide.IOGuardInitializer$IOGuardDelegateImpl.allowNetworkAndCommandLine(IOGuardInitializer.java:6)
        at jetbrains.buildServer.serverSide.IOGuard.allowNetworkAndCommandLine(IOGuard.java:117)
        at jetbrains.buildServer.vcs.impl.VcsLabeler.doSetLabel(VcsLabeler.java:161)
        at jetbrains.buildServer.vcs.impl.VcsLabeler.lambda$createLabelingTasks$4(VcsLabeler.java:155)
        at jetbrains.buildServer.vcs.impl.VcsLabeler.executeTasks(VcsLabeler.java:115)
        at jetbrains.buildServer.vcs.impl.VcsLabeler.updateLabels(VcsLabeler.java:134)
        at jetbrains.buildServer.vcs.impl.VcsLabeler.lambda$new$0(VcsLabeler.java:39)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
[2026-08-13 10:44:59,508]   WARN [prio executor 3] -      jetbrains.buildServer.VCS - Failed to set label '1.0.1' for build #1.0.1 {build id=16918, buildTypeId=Project_ReleaseCandidate}: jetbrains.buildServer.vcs.VcsException: git -c credential.helper= -c credential.helper=/opt/TeamCity/temp/credHelper*.sh push git@bitbucket.org:project/repo 1.0.1 command failed.
exit code: 1
stderr: error: src refspec 1.0.1 does not match any
error: failed to push some refs to 'bitbucket.org:project/repo' (enable debug to see stacktrace)
[2026-08-13 10:44:59,520]   INFO [prio executor 3] -      jetbrains.buildServer.VCS - Labeling VCS root "projectTest_master" {instance id=4, parent internal id=2, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}@x for build #1.0.1 {build id=16918, buildTypeId=Project_ReleaseCandidate}
[2026-08-13 10:45:05,329]   INFO [prio executor 3] -      jetbrains.buildServer.VCS - Tag '1.0.1' was successfully pushed for "projectTest_master" {instance id=4, parent internal id=2, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}
[2026-08-13 10:45:06,419]   INFO [mal executor 12] - iggers.vcs.git.GitMergeSupport - Merge successfully finished in root "projectTest_master" {instance id=3, parent internal id=1, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}, revision x, destination refs/heads/master
[2026-08-13 10:45:06,420]   INFO [mal executor 12] - iggers.vcs.git.GitMergeSupport - Merge in root "projectTest_master" {instance id=4, parent internal id=2, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}, revision x, destination refs/heads/master
[2026-08-13 10:45:10,831]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 2 VCS root instances where periodical checking for changes is required
[2026-08-13 10:45:13,948]   INFO [mal executor 12] - iggers.vcs.git.GitMergeSupport - Merge successfully finished in root "projectTest_master" {instance id=4, parent internal id=2, parent id=ProjectMaster, description: "git@bitbucket.org:project/repo#refs/heads/master"}, revision x, destination refs/heads/master
[2026-08-13 10:45:20,865]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 2 VCS root instances where periodical checking for changes is required
[2026-08-13 10:45:30,869]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 15 VCS root instances where periodical checking for changes is required
[2026-08-13 10:45:40,914]   INFO [anges monitor 1] -      jetbrains.buildServer.VCS - Found 4 VCS root instances where periodical checking for changes is required

 

TeamCity 2026.1.3 (build 222742)

I don't believe the VCS configuration itself is the cause, because my setup worked previously and I did not make any configuration changes before the problem started occurring.

What I find particularly interesting is that there are two VCS root instances pointing to the same repository and branch. The first instance fails to create/push the tag because the local tag apparently does not exist (this one merges), while the second instance successfully creates and pushes it (this one does not merge).

It looks like the Merge and the labeling happens at the same time.

Any guidance on the cause of this behavior and the recommended fix would be greatly appreciated.

Thanks!

1

Please sign in to leave a comment.