Remote build agent connecting to bitbucket behind a proxy

Hi,

I'm trying to setup a Bamboo remote agent to grab source code from a Bitbucket Git repository. The agent runs on Windows behind a proxy. I've setup the repository in my build plan and setup the proxy in Git global settings. Manually cloning the repo from the build agent server works fine, but when triggering a build I get the following:

java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Cannot fetch branch '(unresolved) ' from 'https://bitbucket.org/myaccount/myrepository.git' to source directory 'C:\Services\BambooRemoteAgent\RemoteAgentHome\xml-data\build-dir\DOM-DOMCB-JOB1'. https://bitbucket.org/myaccount/myrepository.git: cannot open git-upload-pack
at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:119)
at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:79)
at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:174)
at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:101)
at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:183)
at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:67)
at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:67)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:204)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:109)
at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50)
at java.lang.Thread.run(Unknown Source)
Caused by: com.atlassian.bamboo.repository.RepositoryException: Cannot fetch branch '(unresolved) ' from 'https://bitbucket.org/myaccount/myrepository.git' to source directory 'C:\Services\BambooRemoteAgent\RemoteAgentHome\xml-data\build-dir\DOM-DOMCB-JOB1'. https://bitbucket.org/myaccount/myrepository.git: cannot open git-upload-pack
at com.atlassian.bamboo.plugins.git.GitOperationHelper.fetch(GitOperationHelper.java:241)
at com.atlassian.bamboo.plugins.git.GitOperationHelper.fetch(GitOperationHelper.java:180)
at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:358)
at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:299)
at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.fillWorkingDirFromVcs(VcsCheckoutTask.java:172)
at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$100(VcsCheckoutTask.java:45)
at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$1.call(VcsCheckoutTask.java:106)
at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$1.call(VcsCheckoutTask.java:102)
at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:100)
... 11 more
Caused by: org.shaded.eclipse.jgit.errors.TransportException: https://bitbucket.org/myaccount/myrepository.git: cannot open git-upload-pack
at org.shaded.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:466)
at org.shaded.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:276)
at com.atlassian.bamboo.plugins.git.GitOperationHelper.withFetchConnection(GitOperationHelper.java:719)
at com.atlassian.bamboo.plugins.git.GitOperationHelper$2.doWithTransport(GitOperationHelper.java:203)
at com.atlassian.bamboo.plugins.git.GitOperationHelper$2.doWithTransport(GitOperationHelper.java:192)
at com.atlassian.bamboo.plugins.git.GitOperationHelper.withTransport(GitOperationHelper.java:703)
at com.atlassian.bamboo.plugins.git.GitOperationHelper.fetch(GitOperationHelper.java:191)
... 19 more
Caused by: java.net.ConnectException: Connection time out: bitbucket.org
at org.shaded.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:173)
at org.shaded.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:429)
... 25 more

Could someone please advise on how to get this working?

Thanks for your help!

1 answer

1 accepted

This widget could not be displayed.

Have you tried specifying the proxy address via java properties? (http://docs.oracle.com/javase/6/docs/technotes/guides/net/proxies.html)

Thanks for your reply.

I've now tried to add this to my wrapper.conf file:

wrapper.java.additional.3=-Dhttp.proxyHost=myproxyhosturl
wrapper.java.additional.4=-Dhttp.proxyPort=8080
wrapper.java.additional.5=-Dhttp.noProxyHosts=”localhost|mybambooserverurl”

I've restarted the service after the change, but it doesn't change anything and I'm still getting the exact same error. Is that what I was supposed to do?

The thing that puzzles me is that in the build log it looks like "something" (not sure if it's the main server, the build agent or git) is able to connect to my repository as it is getting the revision number out corretly. I can see this in the logs and it's matching my bitbucket revision number:

"Updating source code to revision: 41a4c75eb9e0d92823008c0b56572f649dbbbaff"

But just after that I'm getting this:

"Creating local git repository in 'C:\Services\BambooRemoteAgent\xml-data\build-dir\DOM-DOMCB-JOB1\.git'.

Cannot fetch branch '(unresolved) master' from 'https://bitbucket.org/myaccount/myrepository.git' to source directory 'C:\Services\BambooRemoteAgent\xml-data\build-dir\DOM-DOMCB-JOB1'. https://bitbucket.org/myaccount/myrepository.git: cannot open git-upload-pack"

And I forgot to mention earlier that I already have setup the proxy details in the Git global config and I'm using "Git For Windows" and not msysgit. I'm not sure if this has anything to do with the problem.

Any idea?

Thanks for your help

ok, I figured it out. I didn't realise you have to specify different settings for HTTPS. It all works fine now.

Thanks for your help!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

83 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you