Error during GIT vcs operation collecting changes: Revisions missing in the local repository

Answered

We've been testing TeamCIty version 2020.1.2 and recently noticed a VCS error warning that displays on the build configuration home. It only appears in the UI when triggered commit is detected, it puts the build in pending before eventually adding it to the queue (only spends seconds here), and is then picked up by our default agent. We have our VCS root set up with refs/heads/development as the default branch and a branch specification +:refs/heads/feature-* to monitor pushed commits to features. Our VCS trigger uses the default setting.

I've uploaded a file using the JetBrains Upload Service (Upload id: 2021_02_10_PnJRxDH8Sx1jminp) which can hopefully be attached to this query. It shows a portion of the teamcity-vcs.log we've used in debugging. Once a local commit is pushed to a remote branch, i.e. 9ae***fa3, TeamCity cycles through Git and VCS errors before eventually finding the previous revisions and proceeding with the build.

I'm trying to narrow down what is causing the issue so I can make sure it can be avoided when we implement TeamCity on an upcoming project. 

Please let me know if additional information is needed for troubleshooting.  

Jenn

 

0
8 comments
Official comment

Hello Jenn,

I'm TeamCity git integration developer and I've recently investigated your case. I've suggested a possible workaround in the comments to the ticket in TeamCity issue tracker. Please give it a try and let us know if it helps.

https://youtrack.jetbrains.com/issue/TW-66816#focus=Comments-27-4759821.0-0

Cheers, Viktoria

Hello Jenn!

It appears that this is a case of https://youtrack.jetbrains.com/issue/TW-66816 issue; a HEAD of branch which is being fetched cannot be fetched to the local mirror for some reason. Does it affect a single VCS root? 

Could I ask you to:
1) when a new commit is available on any of the feature branches, run 

git show-ref refs/heads/<branch name>

in /home/admin_teamcity/.BuildServer/system/caches/git/git-C5E8FCEB.git and save the output (if you can do this before TeamCity goes through the errors, this would be great);
2) after (or instead of) above, try to backup and remove /home/admin_teamcity/.BuildServer/system/caches/git/git-C5E8FCEB.git path (this is a local mirror of the VCS root in question, on removal TeamCity will try to fetch clean) and check if the issue reoccurs?

Your assistance would be greatly appreciated! If there are any questions or concerns I could help with, please let me know. 

0

Hello Jenn,

Just as a quick follow-up; development team has mentioned 2020.2.2 has a change which could potentially fix the issue. Would an upgrade be feasible for you to check if it resolves the issue? 

0
Avatar
Permanently deleted user

Thanks for your response Fedor! I went through all the scenarios, upgraded our system and unfortunately I'm still seeing the error just prior to the agent picking up the build. 

The show-ref command in my git-C5E8FCEB.git repository references latest commit pushed to the remote. Then when a new commit to github.com, the show-ref command updates to the new commit after ~10 seconds, which is around the time I start seeing the jetbrains.buildServer.vcs.VcsException: Revisions missing in the local repository error. At this point, the build is hanging out in pending while the local mirror of the VCS root catches up. Is it possible this is expected behavior?

If I can provide anything else please let me know. 

0

Hello Jenn,

Thank you for the update! I have forwarded the data to the development team; as soon as I hear from them I will circle back to you.

0
Avatar
Permanently deleted user

From Victory's response, I implemented the following in the terminal on the VM hosting our TeamCity server.

git config --global core.trustFolderStat false

This was added to the ~. /gitignore file.

Error message for VCS root has stopped and our agent is picking up the build instantaneously thanks to triggers and git hooks in place.

0
Avatar
Fedor Rumyantsev

Hello Jenn,

Thank you for the update! 

0

Hi Jenn, please note that it's just a workaround and shouldn't be used permanently for performance reasons.

Please watch the ticket https://youtrack.jetbrains.com/issue/TW-66816 and upgrade the plugin as soon as the fix is released.

Thanks for your help!

0

Please sign in to leave a comment.