Jump to content

Git server fails with "duplicate advertisements of" branch.


Guest Gavin

Recommended Posts

Guest Gavin

Starting to play with git server - looks like it will be a really useful feature for us but having a couple of teething troubles.

The error I'm getting at the moment is...



Test connection failed in TestRespository :: Git Tags

List remote refs failed: org.eclipse.jgit.errors.PackProtocolException: git://myserver/MyRepo: duplicate advertisements of refs/heads/main-feature12345-task67890.

 

 

I get this error when trying to do 'Test Connection' from TeamCity. I seem to be able to clone the repo ok from my machine.

We have a fairly large repo going back a couple of years working from main -> feature branches -> per-task branches, and occasionally branches beyond that. I wondered whether the way the branch names are flattened out results in names which are unusually long. Maybe this is not relevant.

Link to comment
Share on other sites

Thanks.

I've found in my Plastic log file...

Git - The reference name 'refs/heads/main-feature12345-task67890' for the branch '/main/feature12345/task67890' is duplicated. Probably, there are several branches with similar names like /main/task /main-task. The changed reference notificationhas been skipped in the git pull/clone operation

I've spent some time with the plastic query tool but there doesn't look to be any obvious candidates which result in duplicate names, not knowing exactly how the branch names are transformed.

Link to comment
Share on other sites

I've seen the error is coming from a c#/Java Git client implementation, that's maybe why from a standard git client is working fine.

 

Can you send me a list of your branch names?

 

"cm find branch" will do it.

 

If you don't want to public post your branch names you can send them to support at plasticscm dot com.

Link to comment
Share on other sites

Yes, TeamCity seems to use jgit, and while it lets you specify a git binary for the build agents, server operations seem to insist on using jgit.  This is something I'll take that up with JetBrains, but the error in the plastic log suggests there is still a problem at the Plastic end.

I'm working on getting the branch names to you. Listing them was no problem, but need to get somebody to look at the list before I can send.

In the meantime, could you give me some idea of what transformations are applied to the branch names?  Is it just the replacing of '/' with '-', or are there other substitutions that take place or limitations on lengths of branch name?

Link to comment
Share on other sites

Just "/" replaced by a "-" symbol. I'm wondering if, somehow, you can get a duplicated branch name after replacing the symbols. From the error message I guess it has to be something related to the "main-feature12345-task67890" string.

Link to comment
Share on other sites

Ok, I took a copy of our database (SQL Server) and wrote a recursive query to build up the full branch names and found no duplicates.  I then replaced '/' with '-' but still no duplicates.

 

I have attached a file showing the branch which it thinks is duplicate - not sure if this is helpful.  I'm am starting to wonder if perhaps the problem is caused by the origin of the branch.

 

post-31900-0-28242700-1463653915_thumb.png

Link to comment
Share on other sites

Made a bit of progress on this today.
 
First, the branch name it said was duplicated - I renamed that branch, but it didn't solve the problem - the log file still showed...

Git - The reference name 'refs/heads/main-feature12345-task67890' for the branch '/main/feature12345/task67890xxxx' is duplicated

...so the thing that did the translation of the branch names wasn't aware of the new name.

I tried reducing 'mapping.interval' in the gitserver.conf in the hope that it would cause it to be refreshed but that didn't help.

I then set 'storage.baseDirectory' (previouslywas just using the default, wherever that goes to) and this seemed to work - the various files were generated in the folder and the problem with the duplicate references seems to have gone away.

 




 

Link to comment
Share on other sites

I'll look into getting those branch names to you because I would like to help resolve the problem, but it's not as straightforward due to the nature of this particular project, but leave that with me.

When I renamed the offending branch back, removing the 'xxxx' off the end, it works fine. The thing that made the error disappear was changing the 'storage.baseDirectory' value, so whatever was in the folder before I changed that path was in a corrupted state.

I had another issue recently where someone had created a second repository on the server with a similar name (my repo is called 'MyProject' and someone had a created a repo called 'MyProject-OtherProject-Bridge'. When this second repo was created I was unable to clone the first one. To resolve this I had to add 'export.repo=MyProject' to only expose the one specific repo. I wonder whether this could be related? (i.e. is it possible that the branch name it thinks is duplicated is in a different repository)?

Maybe not related, but just trying to provide as much detail as I can.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...