Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I set Bamboo remote agent timeout? Edited

How do I set the value of the "bamboo.agent.heartbeatTimeoutSeconds" property of an agent to "3600"?

I've tried adding it at "<property name="bamboo.agent.heartbeatTimeoutSeconds">" to the bamboo-agent.cfg.xml file but the agents still timeout after 10 minutes.

I've tried starting my agent with the "-Dbamboo.agent.heartbeatTimeoutSeconds" commandline parameter but that throws an error "Error: Could not find or load main class .agent.heartbeatTimeoutSeconds".

I've tried setting it on the server bamboo.cfg.xml file.

I've even tried adding it to the Broker client URL in System General Configuration on the Bamboo server like this:
failover:(tcp://bamboo.dev2.local:54663?wireFormat.maxInactivityDuration=1800000)?initialReconnectDelay=15000&maxReconnectAttempts=60&bamboo.agent.heartbeatTimeoutSeconds=3600

 Thank you for taking the time to read this question through. I just need the timeout to be 60 minutes instead of 10 while I wait for our networking infrastructure to be upgraded some time in 2019.

EDIT: I've tried the suggestion here: https://community.atlassian.com/t5/Bamboo-questions/Can-I-set-a-longer-connection-timeout-for-Bamboo-remote-agents/qaq-p/95927 it looks similar to what i did with the Broker client URL in System General Configuration. But I still get this error:

FATAL [scheduler_Worker-4] [AgentContext] Agent encountered a fatal error: 'The last successful transmission was 10 minutes ago, the heartbeat timeout is 10 minutes, terminating agent'. Exiting.
java.util.concurrent.TimeoutException: The last successful transmission was 10 minutes ago, the heartbeat timeout is 10 minutes, terminating agent
at com.atlassian.bamboo.v2.build.agent.remote.heartbeat.AgentHeartBeatJob.execute(AgentHeartBeatJob.java:57)
at com.atlassian.bamboo.v2.build.agent.remote.heartbeat.AgentHeartBeatJob.execute(AgentHeartBeatJob.java:36)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

Also, I'd welcome any feedback at all. Other questions are being answered much faster than this question, clearly I have not been clear or succinct enough.

2 answers

1 accepted

0 votes
Answer accepted

Hi @Ashley Lewis,

I have a different suggestion for you which is more reliable according to our developers:

  1. Change the broker back to its default value:
    failover:(tcp://<HOST_NAME>:<PORT>?wireFormat.maxInactivityDuration=300000)?initialReconnectDelay=15000&amp;maxReconnectAttempts=10
  2. Make the adjustments on agent side by following the steps on this document: Remote agent does not restart after server outage (the values in that document will set the reconnect attempt time to 2h)

    1. Stop the agent
    2. Edit <bamboo-agent-home>/conf/wrapper.conf
    3. Make sure wrapper.successful_invocation_time is set to 3
      wrapper.successful_invocation_time=3
    4. Change wrapper.max_failed_invocations to 720
      wrapper.max_failed_invocations=720
    5. Start the agent

      ⚠️ Any agent with this configuration should attempt to reconnect for 1h in case the server is temporarily offline.

We also have a feature request to fix this behavior for all agents in future versions: [BAM-18608] Increase the default time taken for the agents to reconnect in case the server is temporarily down

I hope you can apply this change to your agents.
That will also allow you to set different reconnect time for different types of agents.

OK great, I've voted on BAM-18608!

 

Although, I am still confused. I can't find <bamboo-agent-home>/conf/wrapper.conf. None of my <bamboo-agent-home> directories contain a "conf" sub-directory, they all look like this:

plugins\
temp\
xml-data\
agentState\
caches\
classpath\
framework-bundles\
logs\
bamboo-agent.cfg.xml

My Bamboo server home looks like this:

plugins\
serverState\
temp\
templates\
xml-data\
analytics-logs\
artifacts\
backups\
caches\
DotNetSupport\
index\
jms-store\
logs\
bamboo.cfg.xml
bamboo-mail.cfg.xml

Both my Bamboo server and agents log directories do not contain wrapper logs, only atlassian-bamboo.log, emergency-atlassian-bamboo.log and js-atlassian-bamboo.log. Could it be possible that I do not use a wrapper? I am using Windows 10 for my Bamboo agents and Windows Server 2016 for the server.

FYI, here is my Bamboo server install directory listing:
atlassian-bamboo\
bin\
conf\
lib\
licenses\
logs\
scripts\
temp\
tomcat-docs\
tools\
webapps\
work\
bamboo.sh
BambooConsole.bat
BUILDING.txt
CONTRIBUTING.md
InstallAsService.bat
NOTICE
README.html
README.md
README.txt
StartBamboo.bat
StopBamboo.bat
UninstallService.bat

Hi @Ashley Lewis,

I've checked both my windows and linux agents and they all have this folder. Could you share with me:

  1. What is the version of Bamboo you are running?
  2. What is the process used to install your remote agents?

Running Bamboo verison 6.7.2 build 60706 - 10 Dec 18.

To install a new remote Bamboo agent I went to https://<my server domain>/admin/agent/addRemoteAgent.action and downloaded a jar file onto the remote agent machine.

I run the agent like this:

"C:\Program Files\Java\bin\java.exe" -Dbamboo.home=C:\bamboo-home -jar C:\Builds\bamboo-agent-6.7.2.jar https://<my server domain>/agentServer/ console

Hi @Ashley Lewis,

I see what is happening. You are using the agent JAR directly without the wrapper. The page Admin >> Agents >> Install remote agent shares the command you should use for installing an agent. There you will see that we use the installer jar, not the one you are using at the moment.

This is the jar: atlassian-bamboo-agent-installer-6.7.2.jar

Your command should be like:

"C:\Program Files\Java\bin\java.exe" -Dbamboo.home=C:\bamboo-home -jar C:\Builds\bamboo-agent-installer-6.7.2.jar https://<my server domain>/agentServer/ console

By running the installer jar, the conf folder should be created (as it did in my last test on windows with Bamboo 6.7.2). Once you do that you should be able to use this command again with the new configuration set for wrapper.conf.

OK the wrapper is working for me now so I'm marking this as answered. But I should mention I had to check this box to allow UI testing with my Bamboo agent:
interactivesservice.png

Like Daniel Santos likes this

Hi @Ashley Lewis,

Thank you for sharing it. That will probably help others that are running the agent as a service.

I've changed the accepted answer to our first thread. I wrongly created a second thread when answering you. This could create confusion for other users coming to this question.

Thank you for sharing all the issue details with us here. 
I'm glad we could find what was wrong together.

Have a good one!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

684 views 1 6
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you