Bamboo Remote Agent using Linux Systemd service fails to start.

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The bamboo remote agent, which uses the Systemd  service, fails to start successfully. An error message appears in the agent logs stating, "STATUS | wrapper | YYYY/MM/DD HH:MM:SS | <-- Wrapper Stopped". This indicates that the wrapper has stopped.

Environment

The solution has been tested in the following environments:

  • Bamboo Data Center versions 9.6.0 and 9.5.1

  • Red Hat Linux 8.8 and Oracle Enterprise Linux 8.9

Diagnosis

The following error message appears in <Bamboo-agent-home>/atlassian-bamboo-agent.log when starting the Bamboo remote agent systemd service:

STATUS | wrapper  | YYYY/MM/DD HH:MM:SS | <-- Wrapper Stopped" 

After following the steps in "Option 2: Debug only the Remote Agent" to enable Debug Logging, additional log messages can be observed in the atlassian-bamboo-agent.log file.

INFO   | jvm 1    | 2024/03/28 15:09:05 | 2024-03-28 15:09:05,322 INFO [AgentRunnerThread] [RemoteAgent] Starting application context...
DEBUG  | wrapper  | 2024/03/28 15:09:06 | Signal trapped.  Details:
DEBUG  | wrapper  | 2024/03/28 15:09:06 |   signal number=15 (SIGTERM), source="kill, sigsend or raise"
DEBUG  | wrapper  | 2024/03/28 15:09:06 |   signal generated by PID: 18802 (Session PID: 18802), UID: 1000 (beejay)
STATUS | wrapper  | 2024/03/28 15:09:06 | TERM trapped.  Shutting down.
DEBUG  | wrapper  | 2024/03/28 15:09:06 | wrapperStopProcess(0, TRUE) called.
DEBUG  | wrapper  | 2024/03/28 15:09:06 | Sending stop signal to JVM
DEBUG  | wrapperp | 2024/03/28 15:09:06 | Send a packet STOP : NULL

.....

DEBUG  | wrapper  | 2024/03/28 15:09:07 | JVM process exited with a code of 0, leaving the Wrapper exit code set to 0.
DEBUG  | wrapper  | 2024/03/28 15:09:07 | JVM exited normally.
DEBUG  | wrapper  | 2024/03/28 15:09:07 | Exit code: 0
STATUS | wrapper  | 2024/03/28 15:09:07 | <-- Wrapper Stopped 

Cause

The systemd configuration for the remote agent's service was using a 'simple' service type, as shown in the snippet below. This was also tested with other service types including 'exec', 'notify', and 'notify-reload'.

 #cat /etc/systemd/system/bamboo-agent.service
[Unit]
Description=Bamboo Agent
After=syslog.target network.target

[Service]
Type=simple

The service type configures the mechanism through which the service notifies the manager when the service startup is complete. It is recommended to set this service type to 'forking' for a Bamboo remote agent service. This configuration allows the manager to consider the service as started immediately after the binary, which was forked off by the manager exits.


Solution

There are two possible solutions to this issue.

Solution 1

First, delete the systemd service. Next on the remote agent host, use the following command to create a new service file.

 sudo sh <bamboo-agent-home>/bin/bamboo-agent.sh install

This will generate a new systemd service file with the correct configuration. Finally, restart the Bamboo remote agent service.

Solution 2

If you prefer not to delete the systemd service file, simply edit the file and change the service type from 'simple' to 'forking'.

[Unit]
Description=Bamboo Agent
After=syslog.target network.target

[Service]
Type=forking
....

Finally do a reload of the service and restart the service.

# systemctl daemon-reload
# systemctl start bamboo-agent.service




Last modified on Apr 4, 2024

Was this helpful?

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