How to increase debug logging to investigate remote agent problems

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

This knowledge base article is intended to help in troubleshooting agent problems by increasing the logged information on server and/or agent logs.

Solution

Option1: Debug server and agent (requires a server restart)
  1. Edit the <Bamboo-Install>/atlassian-bamboo/WEB-INF/classes/log4j.properties.
  2. The debug classes can be added on demand in your log4j.properties file depending on what problem is being troubleshot:

    SubjectClasses to debug
     Agent Registration
    log4j.category.com.atlassian.bamboo.agent=DEBUG
    log4j.category.com.atlassian.bamboo.v2.build.agent=DEBUG
    log4j.category.com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl=DEBUG
     Agent load
    log4j.category.org.apache.activemq=DEBUG
    External process
    log4j.category.com.atlassian.utils.process=DEBUG
    log4j.logger.com.atlassian.bamboo.executor=DEBUG
    Git
    log4j.logger.com.atlassian.bamboo.plugins.git.GitRepository=DEBUG
  3. Restart both server and agent (the above debugging classes will also take effect on agent logs after the restart) 

Option2: Debug only the agent

If you cannot restart your server, you can enable the logging only on the agent side with the following steps:

  1. Stop your agent
  2. Copy the  <Bamboo-Install>/atlassian-bamboo/WEB-INF/classes/log4j.properties (Bamboo server) to your <Agent_Home> directory
  3. Edit the log4j.properties based on debugging classes suggested in the table above
  4. Configure your agent to load the log4j.properties file:
    Uncomment the line following line on it and add the absolute path to the log4j.properties file you just copied:

    #wrapper.java.additional.3=-Dlog4j.configuration=

    It should look like this after the change:

    wrapper.java.additional.3=-Dlog4j.configuration=<AGENT_HOME>/log4j.properties
  5. Restart the agent

For more info on how to increase log verbosity on remote agents:

Extra debugging: Investigating packet content

For deeper investigation on packet content, network traffic dumps between the agent and the server are helpful.
Please enable the network packet capturing on server side and reproduce the problem. Please refer to
 Capturing HTTP traffic using Wireshark or Fiddler for more details on how to capture the network packet.

Last modified on Dec 14, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.