After registering bamboo agent getting receiving java.io.EOFException error
Asked by Sushant_Jagdale:

Hi All,

We have a bamboo server running on AWS cloud and bamboo agent on premise (running on Mac Mini). After successfully registering the agent with bamboo server and authorising/approving the access on server, we receive below error message.

Can you please advise what is the cause of this error? Kindly revert if anymore information is required.

Below are the agent logs -\>

```

INFO | jvm 1 | 2018/09/26 19:22:02 | 2018-09-26 19:22:02,874 INFO [AgentRunnerThread] [RemoteAgent] * Bamboo agent 'macpro-10053.optus.com.au (2)' ready to receive builds.
INFO | jvm 1 | 2018/09/26 19:22:02 | 2018-09-26 19:22:02,874 INFO [AgentRunnerThread] [RemoteAgent] * Remote Agent Home: /private/var/atlassian/bamboo/bamboo-agent-home
INFO | jvm 1 | 2018/09/26 19:22:02 | 2018-09-26 19:22:02,874 INFO [AgentRunnerThread] [RemoteAgent] * Broker URL: failover:(tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com:54663?wireFormat.maxInactivityDuration=300000)?initialReconnectDelay=15000&maxReconnectAttempts=10
INFO | jvm 1 | 2018/09/26 19:22:02 | 2018-09-26 19:22:02,874 INFO [AgentRunnerThread] [RemoteAgent] * *
INFO | jvm 1 | 2018/09/26 19:22:02 | 2018-09-26 19:22:02,874 INFO [AgentRunnerThread] [RemoteAgent] ***********************************************************************************************************************************************************************************************************************
INFO | jvm 1 | 2018/09/26 19:22:32 | 2018-09-26 19:22:32,561 WARN [ActiveMQ Transport: tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com/10.121.161.92:54663@60744] [FailoverTransport] Transport (tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com:54663?wireFormat.maxInactivityDuration=300000) failed , attempting to automatically reconnect: java.io.EOFException
INFO | jvm 1 | 2018/09/26 19:23:31 | 2018-09-26 19:23:31,559 WARN [ActiveMQ Transport: tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com/10.121.161.92:54663@60746] [FailoverTransport] Transport (tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com:54663?wireFormat.maxInactivityDuration=300000) failed , attempting to automatically reconnect: java.io.EOFException
INFO | jvm 1 | 2018/09/26 19:24:31 | 2018-09-26 19:24:31,558 WARN [ActiveMQ Transport: tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com/10.121.161.92:54663@60751] [FailoverTransport] Transport (tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com:54663?wireFormat.maxInactivityDuration=300000) failed , attempting to automatically reconnect: java.io.EOFException
INFO | jvm 1 | 2018/09/26 19:25:31 | 2018-09-26 19:25:31,556 WARN [ActiveMQ Transport: tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com/10.121.161.92:54663@60753] [FailoverTransport] Transport (tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com:54663?wireFormat.maxInactivityDuration=300000) failed , attempting to automatically reconnect: java.io.EOFException
INFO | jvm 1 | 2018/09/26 19:26:31 | 2018-09-26 19:26:31,556 WARN [ActiveMQ Transport: tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com/10.121.161.92:54663@60763] [FailoverTransport] Transport (tcp://internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com:54663?wireFormat.maxInactivityDuration=300000) failed , attempting to automatically reconnect: java.io.EOFException
```


Answers:
author: Foong
body: The remote agent wants to connect to Bamboo server through the hostname "internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com" and port 54663 but fail to do it.

Is the Incoming connection in Bamboo AWS instance configured for the port number 54663?

Is the Mac mini able to connect to Bamboo through the hostname "internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com"? If not, edit the hostname for **Broker client URL** at *Administration \> System \> General configuration* to use the correct hostname (make sure that **Broker URL** is using hostname 0.0.0.0). Bamboo need to be restarted after the modification.

comments: author: Sushant_Jagdale
body: [@Foong](/t5/user/viewprofilepage/user-id/502088):

Thanks for your prompt response. I can see that telnet and curl works to "internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com" over 54663 port from Mac Mini's (agents).

Firewall is already opened and we can see telnet works both ways (on all ports: 54663, 8085, 443, 80) from bamboo agents to bamboo server.

I can confirm that **Broker URL** is using hostname 0.0.0.0. However, as bamboo server is on cloud we don not want to hardcode hostname/IP address in **Broker client URL** . If i use a load balancer or route53 record in **Broker client URL**instead of bamboo hostname/IP, i am getting mentioned error (java.io.EOFException).

Can you please help confirm below:

1) How to avoid **Broker client URL**as hard coded hostname or IP?

2) Why bamboo agent can't talk to bamboo server over 54663 port when there is Load Balancer in front of bamboo server (connectivity is already there, telnet works).


author: Foong
body: > 1) How to avoid **Broker client URL**as hard coded hostname or IP?

It should work without hard coded hostname or IP too.
> I can see that telnet and curl works to "internal-BuildBamb-BambooEL-1SGA9X3X1UT30-116415493.ap-southeast-2.elb.amazonaws.com" over 54663 port from Mac Mini's (agents).
>
> 2) Why bamboo agent can't talk to bamboo server over 54663 port when there is Load Balancer in front of bamboo server (connectivity is already there, telnet works).

Does it show message like the following example?

```
$ telnet <hostname> 54663
Trying ::1...
Connected to localhost.
Escape character is '^]'.
?ActiveMQ
         p
          TcpNoDelayEnabledSizePrefixDisabled CacheSize
                                                         ProviderName  ActiveMQStackTraceEnabledPlatformDetails KJVM: 1.8.0_73, 25.73-b02, Oracle Corporation, OS: Mac OS X, 10.12.6, x86_64
                            CacheEnabledTightEncodingEnabled
                                                            MaxFrameSize???MaxInactivityDuration?? MaxInactivityDurationInitalDelay'ProviderVersion 5.14.5
```


author: Qing LIANG
body: [@Foong](/t5/user/viewprofilepage/user-id/502088) Hi, I am having exactly the same situation. I got the same telnet message as you posted. However the EOFException on the agent side keeps going. Since the agent is configured to stop when arriving 10 exceptions thrown, I kept getting agents rebooting.

Do you have already a resolution please? I restarted the server but it didn't help.