Fatal error when running Bamboo Remote Agent as Service

Running Bamboo 5.9.1 on Windows 7/x64

Executing jobs on a remote Bamboo agent (starting from the CLI) is working without problems.

After installing the Bamboo agent as a service (using InstallBambooAgent-NT.bat and StartBambooAgent-NT.bat as administrator) the following errors are produced when starting a build:

 

18-Aug-2015 10:07:35Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
18-Aug-2015 10:07:35Updating source code to revision: 2092046078a1e95ff4427733910c2c35ab6f3188
18-Aug-2015 10:07:35C:\Users\bu62ein\AppData\Local\Programs\Git\cmd\git.exe version
18-Aug-2015 10:07:35C:\Users\bu62ein\AppData\Local\Programs\Git\cmd\git.exe log -1 --encoding=UTF-8 --format=%H HEAD
18-Aug-2015 10:07:36C:\Users\bu62ein\AppData\Local\Programs\Git\cmd\git.exe ls-remote ssh://996b848f-72e6-4fd4-bb8c-301e0ea08cb4@127.0.0.1:59838/ac/ipipe.git
18-Aug-2015 10:07:36Cannot fetch branch '(unresolved) master' from 'ssh://git@EINAPPL32:7999/ac/ipipe.git' to source directory 'D:\GIT\bamboo\build\_git-repositories-cache\1bf8fe6b220021b84b29bfe98989b7a6fed81ba6'. com.atlassian.bamboo.plugins.git.GitCommandException: command C:\Users\bu62ein\AppData\Local\Programs\Git\cmd\git.exe ls-remote ssh://996b848f-72e6-4fd4-bb8c-301e0ea08cb4@127.0.0.1:59838/ac/ipipe.git failed with code 128. Working directory was [D:\GIT\bamboo\build\_git-repositories-cache\1bf8fe6b220021b84b29bfe98989b7a6fed81ba6]., stderr:[error: cannot spawn C:\Windows\system32\config\systemprofile\AppData\Local\Temp\bamboo-ssh.41538fd5.bat: No such file or directory, fatal: unable to fork]

 

When running the command from the CLI the following error is returned:

 

D:\tmp>C:\Users\bu62ein\AppData\Local\Programs\Git\cmd\git.exe ls-remote ssh://4
b709691-51a4-4bbb-a2db-2e577f651948@127.0.0.1:59838/ac/ipipe.git
ssh: connect to host 127.0.0.1 port 59838: Bad file number
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

What can be the problem? I would like start using the Service so I am not depending on starting batch files to keep the bamboo agent up and running.

2 answers

I have randomly the same problem on Windows 2012 R2, is there solution on this error.

0 vote

Hello Michal,

Issue

stderr:[error: cannot spawn C:\Windows\system32\config\systemprofile\AppData\Local\Temp\bamboo-ssh.41538fd5.bat: No such file or directory, fatal: unable to fork]

The issue relates to Bamboo not being able to write to the temporary directory. In this case, please:

Bamboo Server

If running builds against the Bamboo server and/or Bamboo Local Agent(s)

  1. stop Bamboo (bring the instance down)
  2. edit <bamboo-install>/bin/setenv.sh (Linux/MacOS), setenv.bat (Win) and append the following property to JVM_SUPPORT_RECOMMENDED_ARGS=

    # on Linux/MacOS
    -Djava.io.tmpdir=/opt/temp
     
    # on Windows
    -Djava.io.tmpdir=C:\temp
  3. start Bamboo

Bamboo Remote Agent

  1. stop Bamboo Remote Agent (bring the agent down)
  2. edit <bamboo-remote-agent>/conf/wrapper.conf and add the following:

    # on LinuxMacOS
    wrapper.java.additional.X=-Djava.io.tmpdir=/opt/temp
     
    # on Windows
    wrapper.java.additional.X=-Djava.io.tmpdir=C:\temp

    information Where X is the next number in sequence

  3. start Bamboo Remote Agent

Bamboo as Windows Service

  1. Identify the name of the service that Bamboo is installed as by going to "Control Panel >> Administrative Tools >> Services".
  2. Right click on the Bamboo service and select "Properties"
  3. The name of the service is shown after "Service name"
  4. Open the command window from "Start >> Run >> type in 'cmd' >> Enter"
  5. In this command window, cd to the <bamboo-install>\bin directory.
  6. Run tomcat7w //ES//%SERVICENAME% (prior Bamboo v5.10.0).
    Run tomcat8w //ES//%SERVICENAME% (Bamboo v5.10.0 and above)

  7. Click on the Java tab and add these to the list of current startup options:

    -Djava.io.tmpdir=C:\temp

    information Note: Each option must be on its own line.

  8. Apply the changes and restart the Bamboo service for those to take effect.

Notes

information Please, make sure the directory provided as temporary directory exists and the user running Bamboo has full permissions against it.

Kind regards,
Rafael P. Sperafico

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,567 views 0 6
Read article

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