Unable to collect changes - how to fix?

Unable to collect changes: jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.


'git fetch' command failed.
stderr: Exception in thread "main" org.eclipse.jgit.errors.TransportException:

git@github.com:.<...>: java.net.SocketException: Permission denied: connect

How to troubleshoot this? The vcs settings seem right, using ssh, and the "Test connection" test succeeds.

Also the Vcs checkout mode combo box is disabled, and set to "Automatically on server". Why?

5 comments
Comment actions Permalink

Please provide the whole error message with stacktrace.
Most likely the settings are disabled because build configuration is inherited from template. In this case checkout mode can be changed in template only.

0
Comment actions Permalink

TeamCity server and build agent are on the same win7 box.

The latest things I have tried include creating a user account for the build agent service. Didn't help.

Do I need to open any ports on my firewall for this to work? TeamCity server is not accessible from the outside.

No "service hooks" have been configured on github for TeamCIty. I don't know if I will need this.

git, git_gui, tortoiosegit all work correctly.

I copied most of the entire page as well.



-------------------------------------------------------------------------------------------------------
Idle     Run custom build
bc1 Last built: Failed to start build #9 on Win7-64 (and 1 more) view details »
SQLiteDotNet
Help Feedback
TeamCity Professional Version 6.0.2 (build 15857)
License agreement
close
close
Server is unavailable
Server communication failure

Server stopped or communication with the server is not possible due to network failure.

Server shutdown started.
close
TODO
<your comment here>
Loading related builds... Loading related builds to stop ...
Cancel Please wait...

Adding to queue...
View build results » Failed to start build #9 on Win7-64
Unable to collect changes: jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.
Show stacktrace »
java.util.concurrent.ExecutionException: jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.
stderr: Exception in thread "main" org.eclipse.jgit.errors.TransportException: git@github.com:PaulS/SQLiteDotNetProvider.git: java.net.SocketException: Permission denied: connect
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:140)
at org.eclipse.jgit.transport.TransportGitSsh.exec(TransportGitSsh.java:150)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:247)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:100)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:121)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:111)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:880)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.fetch(Fetcher.java:67)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.main(Fetcher.java:43)
Caused by: com.jcraft.jsch.JSchException: java.net.SocketException: Permission denied: connect
at com.jcraft.jsch.Util.createSocket(Util.java:386)
at com.jcraft.jsch.Session.connect(Session.java:182)
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:133)
... 8 more


at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at jetbrains.buildServer.serverSide.impl.CancelableTaskHolder.waitForTaskToComplete(CancelableTaskHolder.java:24)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl.doCollectChanges(TopBuildDependencyGraphImpl.java:77)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl.access$000(TopBuildDependencyGraphImpl.java:32)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl$3.run(TopBuildDependencyGraphImpl.java:1)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl$3.run(TopBuildDependencyGraphImpl.java:2)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl$4.run(TopBuildDependencyGraphImpl.java:1)
at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAs(SecurityContextImpl.java:0)
at jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAsSystem(SecurityContextImpl.java:26)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl.runAsSystem(TopBuildDependencyGraphImpl.java:59)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl.collectChangesForGraph(TopBuildDependencyGraphImpl.java:10)
at jetbrains.buildServer.serverSide.impl.dependency.TopBuildDependencyGraphImpl.collectChangesForGraph(TopBuildDependencyGraphImpl.java:40)
at jetbrains.buildServer.serverSide.impl.BuildChangesCollector.collectChangesForBuild(BuildChangesCollector.java:6)
at jetbrains.buildServer.serverSide.impl.BuildStarter$1.run(BuildStarter.java:21)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.
stderr: Exception in thread "main" org.eclipse.jgit.errors.TransportException: git@github.com:PaulS/SQLiteDotNetProvider.git: java.net.SocketException: Permission denied: connect
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:140)
at org.eclipse.jgit.transport.TransportGitSsh.exec(TransportGitSsh.java:150)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:247)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:100)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:121)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:111)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:880)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.fetch(Fetcher.java:67)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.main(Fetcher.java:43)
Caused by: com.jcraft.jsch.JSchException: java.net.SocketException: Permission denied: connect
at com.jcraft.jsch.Util.createSocket(Util.java:386)
at com.jcraft.jsch.Session.connect(Session.java:182)
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:133)
... 8 more


at jetbrains.buildServer.buildTriggers.vcs.git.CommandLineUtil.getCommandLineError(CommandLineUtil.java:41)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchDataInSeparateProcess(GitVcsSupport.java:1132)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetch(GitVcsSupport.java:1024)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchData(GitVcsSupport.java:1007)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getCurrentVersion(GitVcsSupport.java:950)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.getCurrentVersion(VcsChangesLoader.java:43)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.getVersionsForAllRoots(VcsManagerImpl.java:213)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:332)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:49)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java:1)
... 5 more
Edit this VCS root » VCS problem: SqliteGit
'git fetch' command failed.
stderr: Exception in thread "main" org.eclipse.jgit.errors.TransportException: git@github.com:PaulS/SQLiteDotNetProvider.git: java.net.SocketException: Permission denied: connect
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:140)
at org.eclipse.jgit.transport.TransportGitSsh.exec(TransportGitSsh.java:150)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:247)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:100)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:121)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:111)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:880)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.fetch(Fetcher.java:67)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.main(Fetcher.java:43)
Caused by: com.jcraft.jsch.JSchException: java.net.SocketException: Permission denied: connect
at com.jcraft.jsch.Util.createSocket(Util.java:386)
at com.jcraft.jsch.Session.connect(Session.java:182)
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:133)
... 8 more
« Hide stacktrace
jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.
stderr: Exception in thread "main" org.eclipse.jgit.errors.TransportException: git@github.com:PaulS/SQLiteDotNetProvider.git: java.net.SocketException: Permission denied: connect
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:140)
at org.eclipse.jgit.transport.TransportGitSsh.exec(TransportGitSsh.java:150)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:247)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:100)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:121)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:111)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:880)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.fetch(Fetcher.java:67)
at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.main(Fetcher.java:43)
Caused by: com.jcraft.jsch.JSchException: java.net.SocketException: Permission denied: connect
at com.jcraft.jsch.Util.createSocket(Util.java:386)
at com.jcraft.jsch.Session.connect(Session.java:182)
at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:133)
... 8 more


at jetbrains.buildServer.buildTriggers.vcs.git.CommandLineUtil.getCommandLineError(CommandLineUtil.java:41)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchDataInSeparateProcess(GitVcsSupport.java:1132)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetch(GitVcsSupport.java:1024)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchData(GitVcsSupport.java:1007)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getCurrentVersion(GitVcsSupport.java:950)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.getCurrentVersion(VcsChangesLoader.java:43)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.getVersionsForAllRoots(VcsManagerImpl.java:213)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:332)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:49)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

0
Comment actions Permalink

Hi Paul,
could you please set an internal property teamcity.git.fetch.separate.process=false and see if it helps?
In order to avoid OutOfMemory errors we create a separate process for fetch, with option teamcity.git.fetch.separate.process=false TeamCity will do fetch in the server process.
If it helps than I suppose your firewall blocks a new fetch process created by TeamCity.

0
Comment actions Permalink

Thanks.
I will mark this as the correct answer with some reservations.

The instuctions are somewhat vague and you have to be good at reading between the lines.

I added the setting to the java parameters, then via experiment found that server restart was required.

By giving the build agent it's own normal user, it probably could not access the c:\users\username\.buildserver directory. I think the build agent should be installed while logged in under it's own user. Don't know.

I had also tried with the firewall off before, and it made no difference.

Anyway it started to work, but then could not find the .sln file, and I had to edit that into the project-config.xml file, and restart the build agent service. (The TeamCity UI could say "Put the name of the sln file here." to make it a little more clear.) Builds ok.

Now I need to learn if I can get it to do a batch build, as in vs2008 batch build menu item.

0
Comment actions Permalink

You are right about the firewall blocking a new fetch process.
I find the turning windows firewall off makes no difference because I am also running a firewall controller that seems to block programs even if the firewall is off. If I disable the firewall controller the new process works. I have learned something here.  There is usually a UI popup to allow a new program to use the network  but that didn't happen - it just silently blocked it.
For now I will use your setting.

0

Please sign in to leave a comment.