4

My build is running on Windows Server 2003, TeamCity 6.0.3. The git repository is stored on the same server and is accessed via cygwin's sshd and gitd. My vcs configuration in TeamCity is as follows:

Fetch URL: git://server/Repo

Push URL: ssh://server/~/Repo

Authentication settings

Authentication Method: Password

User name: TeamCitySC (this is a local account set up specifically for labeling)

Password: * * * * * *

for each user there is a symlink in their home path to the Repository hence the ~/Repo path. Labeling worked just fine for about a 100 builds, recently it has periodically started to complain with the following message:

Labeling failed for root 'git root' org.eclipse.jgit.api.errors.JGitInternalException: Updating the ref refs/tags/build-108 to Tag[03e70a74b39c1393f5ce684424194210513b4d48]={ object 0f6101df222f5370a17f5ce1c97eb2348d64970c type commit tag build-108 tagger PersonIdent[SYSTEM, SYSTEM@server, Thu May 26 16:16:07 2011 -0600] } failed. ReturnCode from RefUpdate.update() was REJECTED at org.eclipse.jgit.api.TagCommand.call(TagCommand.java:159) at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.label(GitVcsSupport.java:1334) at jetbrains.buildServer.vcs.impl.VcsLabeler.setLabel(VcsLabeler.java:80) at jetbrains.buildServer.vcs.impl.VcsLabeler.setLabel(VcsLabeler.java:1) at jetbrains.buildServer.serverSide.impl.FinishedBuildImpl.setLabel(FinishedBuildImpl.java:10) at jetbrains.buildServer.serverSide.impl.auth.SecuredBuildFactory$SecuredFinishedBuildImpl.setLabel(SecuredBuildFactory.java:3) at jetbrains.buildServer.controllers.SetLabelAction.doProcess(SetLabelAction.java:11) at etc...

It continues to fail even when I manually try to label the build via TeamCity (i.e. 'Label this build sources' link in the Changes tab for a given build).

Dave Schweisguth
  • 36,475
  • 10
  • 98
  • 121
Vadim
  • 17,897
  • 4
  • 38
  • 62

2 Answers2

5

From the ReturnCode REJECTED in the error message it seems like your repository already has tag refs/tags/build-108 and TeamCity does not force rewrite existing tag.

neverov
  • 1,283
  • 8
  • 11
  • One would think so, but that is not the case. – Vadim May 27 '11 at 14:19
  • 2
    Did you check repository on TeamCity machine? It could be found at one of subdirectories of `.BuildServer/system/caches/git`, it should be called something like `git-1E07B16A.git`. Once you find it, run command `git --git-dir=/full/path/to/.BuildServer/system/caches/git/you_repo.git tag`. Maybe tag was created only in TeamCity repository and wasn't pushed to your repository. – neverov May 30 '11 at 07:02
  • That's what it was, thanks. Still having an issue, but now it's giving me a git error, that I can troubleshoot – Vadim May 30 '11 at 14:14
  • 2
    This could happen if you have several VCS roots for a single repository and some of them do labeling. – neverov May 31 '11 at 06:13
  • Using git to try and push the tags revealed my problem; permissions error in Stash on tags matching a pattern. – Carl G Dec 21 '13 at 08:22
0

Upgrade to TeamCity 6.5. It was released yesterday. We have had quite a lot of trouble with the DVCS functionality in 6.0.x. 6.5 is a great improvement. If the upgrade does not solve your issue, reply here. It made a lot of headaches for us go away. I'm not sure, but they may have dropped jgit. Seems that jgit has a lot of functionality missing and TeamCity has to work around those in the version you are using. Submodule support is one such feature.

I would also stay away from cygwin and go for the latest msysgit on the server. Cygwin also proved to be much more troublesome than msysgit.

Hope this helps.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
  • I'm going to try upgrading, but fwiw, we're only using cygwin for the ssh server and for installing a service that runs msysgit as a daemon as per [this question](http://stackoverflow.com/questions/233421/hosting-git-repository-in-windows) – Vadim May 27 '11 at 03:29
  • have you looked at gitolite and hosting on a linux box? It works like a charm. – Adam Dymitruk May 27 '11 at 18:51