How to make an offline remote agent online?
Asked by Tem Ed:

I restarted my system and found out that my remote agent has been turned offline.

A post suggested to start it again using the batch file. I did and it shows:

```
C:\Agent\bin>StartBambooAgent-NT.bat
ERROR | wrapper | 2019/07/07 22:51:49 | The Bamboo Remote Agent service is already running with status: RUNNING
Press any key to continue . . .
```

So i looked for error in the log file (atlassian-bamboo-agent.log.1). This is what I found (it keeps on repeating):

```
STATUS | wrapper | 2019/07/07 22:51:52 | Launching a JVM...
INFO | jvm 162 | 2019/07/07 22:51:53 | Wrapper (Version 3.2.3-atlassian-1) http://wrapper.tanukisoftware.org
INFO | jvm 162 | 2019/07/07 22:51:53 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO | jvm 162 | 2019/07/07 22:51:53 | 
INFO | jvm 162 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,193 INFO [WrapperSimpleAppMain] [AgentBootstrap] Starting Agent Bootstrap using Java 1.8.0_161 from Oracle Corporation. Default charset: windows-1252, file name encoding: Cp1252
INFO | jvm 162 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,193 INFO [WrapperSimpleAppMain] [AgentBootstrap] Agent bootstrap using endpoint: http://192.168.99.1:8085/agentServer/
INFO | jvm 162 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,208 INFO [WrapperSimpleAppMain] [RemoteAgentHomeLocatorForBootstrap] Using agent home located at [C:\Agent]
INFO | jvm 162 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,208 INFO [WrapperSimpleAppMain] [RemoteAgentHomeLocatorForBootstrap] Using agent home located at [C:\Agent]
INFO | jvm 162 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,239 INFO [WrapperSimpleAppMain] [AgentUuidInitializer] Found agent UUID '551d80cf-db13-4ecd-b99b-cbae303cea1e' in agent config file 
STATUS | wrapper | 2019/07/07 22:51:53 | Launching a JVM...
INFO | jvm 192 | 2019/07/07 22:51:53 | Wrapper (Version 3.2.3-atlassian-1) http://wrapper.tanukisoftware.org
INFO | jvm 192 | 2019/07/07 22:51:53 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO | jvm 192 | 2019/07/07 22:51:53 | 
INFO | jvm 192 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,768 INFO [WrapperSimpleAppMain] [AgentBootstrap] Starting Agent Bootstrap using Java 1.8.0_161 from Oracle Corporation. Default charset: windows-1252, file name encoding: Cp1252
INFO | jvm 192 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,768 INFO [WrapperSimpleAppMain] [AgentBootstrap] Agent bootstrap using endpoint: http://192.168.99.1:8085/agentServer/
INFO | jvm 192 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,799 INFO [WrapperSimpleAppMain] [RemoteAgentHomeLocatorForBootstrap] Using agent home located at [C:\Agent]
INFO | jvm 192 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,799 INFO [WrapperSimpleAppMain] [RemoteAgentHomeLocatorForBootstrap] Using agent home located at [C:\Agent]
INFO | jvm 192 | 2019/07/07 22:51:53 | 2019-07-07 22:51:53,877 INFO [WrapperSimpleAppMain] [AgentUuidInitializer] Found agent UUID '551d80cf-db13-4ecd-b99b-cbae303cea1e' in agent config file 
INFO | jvm 162 | 2019/07/07 22:52:03 | 2019-07-07 22:52:03,085 INFO [WrapperSimpleAppMain] [AgentContext] Requesting fingerprint, url: http://192.168.99.1:8085/agentServer/GetFingerprint.action?hostName=DESKTOP&version=3&agentUuid=551d80cf-db13-4ecd-b99b-cbae303cea1e
INFO | jvm 162 | 2019/07/07 22:52:03 | 2019-07-07 22:52:03,089 INFO [WrapperSimpleAppMain] [RemoteAgentHttpClientFactory] Creating a new HTTP client...
INFO | jvm 192 | 2019/07/07 22:52:03 | 2019-07-07 22:52:03,053 INFO [WrapperSimpleAppMain] [AgentContext] Requesting fingerprint, url: http://192.168.99.1:8085/agentServer/GetFingerprint.action?hostName=DESKTOP&version=3&agentUuid=551d80cf-db13-4ecd-b99b-cbae303cea1e
INFO | jvm 192 | 2019/07/07 22:52:03 | 2019-07-07 22:52:03,061 INFO [WrapperSimpleAppMain] [RemoteAgentHttpClientFactory] Creating a new HTTP client...
INFO | jvm 197 | 2019/07/07 22:52:03 | Exiting due to fatal exception.
INFO | jvm 197 | 2019/07/07 22:52:03 | org.apache.http.conn.HttpHostConnectException: Connect to 192.168.99.1:8085 [/192.168.99.1] failed: Connection timed out: connect
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initFingerprint(AgentContext.java:114)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initServerSession(AgentContext.java:101)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.run(AgentContext.java:88)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.run(AgentBootstrap.java:111)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.main(AgentBootstrap.java:50)
INFO | jvm 197 | 2019/07/07 22:52:03 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 197 | 2019/07/07 22:52:03 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO | jvm 197 | 2019/07/07 22:52:03 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.lang.reflect.Method.invoke(Method.java:498)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.lang.Thread.run(Thread.java:748)
INFO | jvm 197 | 2019/07/07 22:52:03 | Caused by: java.net.ConnectException: Connection timed out: connect
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.Socket.connect(Socket.java:589)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
INFO | jvm 197 | 2019/07/07 22:52:03 | ... 21 more
INFO | jvm 197 | 2019/07/07 22:52:03 | 2019-07-07 22:52:03,377 FATAL [WrapperSimpleAppMain] [AgentBootstrap] Exiting due to fatal exception.
INFO | jvm 197 | 2019/07/07 22:52:03 | org.apache.http.conn.HttpHostConnectException: Connect to 192.168.99.1:8085 [/192.168.99.1] failed: Connection timed out: connect
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initFingerprint(AgentContext.java:114)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.initServerSession(AgentContext.java:101)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentContext.run(AgentContext.java:88)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.run(AgentBootstrap.java:111)
INFO | jvm 197 | 2019/07/07 22:52:03 | at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.main(AgentBootstrap.java:50)
INFO | jvm 197 | 2019/07/07 22:52:03 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 197 | 2019/07/07 22:52:03 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO | jvm 197 | 2019/07/07 22:52:03 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.lang.reflect.Method.invoke(Method.java:498)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.lang.Thread.run(Thread.java:748)
INFO | jvm 197 | 2019/07/07 22:52:03 | Caused by: java.net.ConnectException: Connection timed out: connect
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
INFO | jvm 197 | 2019/07/07 22:52:03 | at java.net.Socket.connect(Socket.java:589)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
INFO | jvm 197 | 2019/07/07 22:52:03 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
INFO | jvm 197 | 2019/07/07 22:52:03 | ... 21 more
ERROR | wrapper | 2019/07/07 22:52:03 | JVM exited unexpectedly.
INFO | jvm 162 | 2019/07/07 22:52:06 | 2019-07-07 22:52:06,229 INFO [WrapperSimpleAppMain] [AgentContext] Authenticating against Bamboo server at http://192.168.99.1:8085/agentServer/
INFO | jvm 192 | 2019/07/07 22:52:06 | 2019-07-07 22:52:06,965 INFO [WrapperSimpleAppMain] [AgentContext] Authenticating against Bamboo server at http://192.168.99.1:8085/agentServer/
INFO | jvm 160 | 2019/07/07 22:52:07 | Exiting due to fatal exception.
INFO | jvm 160 | 2019/07/07 22:52:07 | org.apache.http.conn.HttpHostConnectException: Connect to 192.168.99.1:8085 [/192.168.99.1] failed: Connection timed out: connect
```

Any help would be appreciated. Thank you.


Answers:
author: Daniel Santos
body: Hi [@Tem Ed](/t5/user/viewprofilepage/user-id/3372173)

It is possible that your agent was installed as a service and the service is attempting to reestablish the agent process over and over.

<br />

It is also possible that your Bamboo URL or IP address was changed. This could cause your agent to fail the attempt to connect with the Bamboo server.

Things I would check:

1. Is the agent running as a service? If yes, try to restart it from windows services admin tool.
2. If it does not work:
   1. Are there any changes in the Bamboo server URL or IP address?
   2. Is the agent machine able to reach the Bamboo server using http://192.168.99.1:8085 ?

In case you need to change the Bamboo server address reference in your agent please:

1. Stop the agent process (or service).
2. Edit the file **\<Bamboo_Agent\>/conf/wrapper.conf**.
3. Find the property below and update the Bamboo URL.

   ```
   wrapper.app.parameter.2=<URL>
   ```

4. Start the agent again.

Please let me know if that helps.

comments: author: Tem Ed
body: Thanks [@Daniel Santos](/t5/user/viewprofilepage/user-id/502125) !

It worked! The problem was that I was running this on my local system so the Bamboo server was running on http://localhost:8085 while the agent kept on connecting to 192.168.99.1:8085.

So changing the URL helped - both in the wrapper.conf and in the command to start the agent.

Thanks a lot!


author: Daniel Santos
body: Hi [@Tem Ed](/t5/user/viewprofilepage/user-id/3372173),

I'm glad it worked! I hope now things go smoothly =\]  
Have a good one!