VCS problem: 'git fetch' command failed

Hi all,

This is my first post here and I am new to TeamCity as a product. I am making use of Teamcity 9.1.3 (build 37176) which was set up a few months ago.

I make use of a Gitlab server for version control and am setting up a project on TeamCity to pull from Gitlab.

Here is some information about my project setup.

I have set my Fetch URL to ssh://git@<SERVER-URL>/ipt/vagrant-automation.git where <SERVER-URL> is obviously masked. When I do a connection test it comes up as successful.

I make use of server-side checkout mode and I provide a SSH key to use for the project. If I manually make use of the SSH key from the server command line under the 'teamcity' user I can check out the code perfectly. This points to the fact that it is not a problem with project permissions or SSH keys.

When I try to run a build it pops up a box with title VCS problem: git@<SERVER-URL>:ipt/vagrant-automation.git#refs/heads/master. The contents of the message are as follows:

Failed for the root '"git@<SERVER-URL>:ipt/vagrant-automation.git#refs/heads/master" {instance id=42, parent internal id=3, parent id=Test_Git<SERVER-SHORTENED-NAME>IptVagrantAutomationGitRefsHeadsMaster, description: "git@<SERVER-URL>:ipt/vagrant-automation.git#refs/heads/master"}: 'git fetch' command failed.
exception: Cannot run program "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-2.b17.el7_1.x86_64/jre/bin/java" (in directory "/opt/TeamCity/.BuildServer/system/caches/git/git-ABF7059A.git"): error=2, No such file or directory
exit code: -1


The full stack  trace shows the following:
 

jetbrains.buildServer.vcs.VcsRootVcsException: 'git fetch' command failed.
exception: Cannot run program "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-2.b17.el7_1.x86_64/jre/bin/java" (in directory "/opt/TeamCity/.BuildServer/system/caches/git/git-ABF7059A.git"): error=2, No such file or directory
exit code: -1
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:2)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:206)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:498)
at jetbrains.buildServer.serverSide.impl.BuildStarter$3.call(BuildStarter.java:21)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:104)
at jetbrains.buildServer.serverSide.impl.BuildStarter$4.call(BuildStarter.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.
exception: Cannot run program "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-2.b17.el7_1.x86_64/jre/bin/java" (in directory "/opt/TeamCity/.BuildServer/system/caches/git/git-ABF7059A.git"): error=2, No such file or directory
exit code: -1
at jetbrains.buildServer.buildTriggers.vcs.git.CommandLineUtil.getCommandLineError(CommandLineUtil.java:52)
at jetbrains.buildServer.buildTriggers.vcs.git.CommandLineUtil.getCommandLineError(CommandLineUtil.java:35)
at jetbrains.buildServer.buildTriggers.vcs.git.FetchCommandImpl.fetchInSeparateProcess(FetchCommandImpl.java:161)
at jetbrains.buildServer.buildTriggers.vcs.git.FetchCommandImpl.fetch(FetchCommandImpl.java:83)
at jetbrains.buildServer.buildTriggers.vcs.git.CommitLoaderImpl.fetch(CommitLoaderImpl.java:105)
at jetbrains.buildServer.buildTriggers.vcs.git.CommitLoaderImpl.fetchBranchData(CommitLoaderImpl.java:142)
at jetbrains.buildServer.buildTriggers.vcs.git.CommitLoaderImpl.loadCommit(CommitLoaderImpl.java:74)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.buildPatch(GitVcsSupport.java:164)
at jetbrains.vcs.api.services.patches.BuildPatchUtil.buildPatch(BuildPatchUtil.java:6)
at jetbrains.vcs.api.services.patches.PatchServiceBase.buildPatchImpl(PatchServiceBase.java:6)
at jetbrains.vcs.api.services.patches.CleanPatchServiceImplA.buildCleanPatch(CleanPatchServiceImplA.java:2)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatchToStream(PatchComposer.java:37)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.access$200(PatchComposer.java:203)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer$2.constructPatch(PatchComposer.java:5)
at jetbrains.buildServer.serverSide.impl.projectSources.SmallPatchCache.getCachedCleanPatch(SmallPatchCache.java:30)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchCacheImpl.requestCachedPatch(PatchCacheImpl.java:0)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.getOrMakeCacheableCleanPatch(PatchComposer.java:124)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makeCleanPatch(PatchComposer.java:120)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:34)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:62)
... 9 more
jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.
exception: Cannot run program "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-2.b17.el7_1.x86_64/jre/bin/java" (in directory "/opt/TeamCity/.BuildServer/system/caches/git/git-ABF7059A.git"): error=2, No such file or directory
exit code: -1
at jetbrains.buildServer.buildTriggers.vcs.git.CommandLineUtil.getCommandLineError(CommandLineUtil.java:52)
at jetbrains.buildServer.buildTriggers.vcs.git.CommandLineUtil.getCommandLineError(CommandLineUtil.java:35)
at jetbrains.buildServer.buildTriggers.vcs.git.FetchCommandImpl.fetchInSeparateProcess(FetchCommandImpl.java:161)
at jetbrains.buildServer.buildTriggers.vcs.git.FetchCommandImpl.fetch(FetchCommandImpl.java:83)
at jetbrains.buildServer.buildTriggers.vcs.git.CommitLoaderImpl.fetch(CommitLoaderImpl.java:105)
at jetbrains.buildServer.buildTriggers.vcs.git.CommitLoaderImpl.fetchBranchData(CommitLoaderImpl.java:142)
at jetbrains.buildServer.buildTriggers.vcs.git.CommitLoaderImpl.loadCommit(CommitLoaderImpl.java:74)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.buildPatch(GitVcsSupport.java:164)
at jetbrains.vcs.api.services.patches.BuildPatchUtil.buildPatch(BuildPatchUtil.java:6)
at jetbrains.vcs.api.services.patches.PatchServiceBase.buildPatchImpl(PatchServiceBase.java:6)
at jetbrains.vcs.api.services.patches.CleanPatchServiceImplA.buildCleanPatch(CleanPatchServiceImplA.java:2)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatchToStream(PatchComposer.java:37)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.access$200(PatchComposer.java:203)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer$2.constructPatch(PatchComposer.java:5)
at jetbrains.buildServer.serverSide.impl.projectSources.SmallPatchCache.getCachedCleanPatch(SmallPatchCache.java:30)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchCacheImpl.requestCachedPatch(PatchCacheImpl.java:0)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.getOrMakeCacheableCleanPatch(PatchComposer.java:124)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makeCleanPatch(PatchComposer.java:120)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:34)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:62)
at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:206)
at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:498)
at jetbrains.buildServer.serverSide.impl.BuildStarter$3.call(BuildStarter.java:21)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:104)
at jetbrains.buildServer.serverSide.impl.BuildStarter$4.call(BuildStarter.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


Any ideas of what could be wrong?

Thanks
Tyrone

1 comment

Fixed the problem.

Java updated on the machine and so the wrong version of java was being referenced by the environmental variable which caused the above error.

Rebooted the machine and everything worked perfectly again!

Cheers
Tyrone

0

Please sign in to leave a comment.