Could not bind to EIP - String index out of range: -4

338 views
Skip to first unread message

daniel.l...@gmail.com

unread,
Aug 22, 2014, 4:54:17 AM8/22/14
to eureka_...@googlegroups.com
I'm currently doing a small PoC with some netflix oss components, mainly based on the flux-capacitator application. I only have one eureka instance, and its in the eu-west-1 region.

From time to time I'm seeing the following exeception thrown by my Eureka server.
As suggested in another thread related to a different Could not bind to EIP, I enabled apache logging
(log4j.logger.org.apache.http=DEBUG), but I'm not seeing anything useful.

2014-08-22 08:51:03,825 DEBUG org.apache.http.impl.conn.DefaultClientConnection:254 [batcher.54.77.156.39-Heartbeat-process] [receiveResponseHeader] Receiving response: HTTP/1.1 200 OK
2014-08-22 08:51:03,825 DEBUG org.apache.http.impl.conn.DefaultClientConnection:257 [batcher.54.77.156.39-Heartbeat-process] [receiveResponseHeader] << HTTP/1.1 200 OK
2014-08-22 08:51:03,825 DEBUG org.apache.http.impl.conn.DefaultClientConnection:260 [batcher.54.77.156.39-Heartbeat-process] [receiveResponseHeader] << Server: Apache-Coyote/1.1
2014-08-22 08:51:03,825 DEBUG org.apache.http.impl.conn.DefaultClientConnection:260 [batcher.54.77.156.39-Heartbeat-process] [receiveResponseHeader] << Content-Type: application/json
2014-08-22 08:51:03,825 DEBUG org.apache.http.impl.conn.DefaultClientConnection:260 [batcher.54.77.156.39-Heartbeat-process] [receiveResponseHeader] << Content-Length: 0
2014-08-22 08:51:03,826 DEBUG org.apache.http.impl.conn.DefaultClientConnection:260 [batcher.54.77.156.39-Heartbeat-process] [receiveResponseHeader] << Date: Fri, 22 Aug 2014 08:51:03 GMT
2014-08-22 08:51:03,826 DEBUG org.apache.http.impl.client.DefaultRequestDirector:540 [batcher.54.77.156.39-Heartbeat-process] [execute] Connection can be kept alive indefinitely
2014-08-22 08:36:05,635 ERROR com.netflix.eureka.EurekaBootStrap$1:261 [Eureka-EIPBinder] [run] Could not bind to EIP
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
at java.lang.String.substring(String.java:1911)
at com.netflix.eureka.util.EIPManager.getEIPsFromServiceUrls(EIPManager.java:312)
at com.netflix.eureka.util.EIPManager.getEIPsForZoneFromConfig(EIPManager.java:292)
at com.netflix.eureka.util.EIPManager.getCandidateEIPs(EIPManager.java:269)
at com.netflix.eureka.util.EIPManager.isEIPBound(EIPManager.java:105)
at com.netflix.eureka.EurekaBootStrap$1.run(EurekaBootStrap.java:251)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)


I'm so far not really seeing any impact to the service, but it would still be interesting to know what is causing this exception.

Any clues as to where I should start looking

Regards
Daniel

Nitesh Kant

unread,
Aug 25, 2014, 8:12:04 PM8/25/14
to eureka_...@googlegroups.com, daniel.l...@gmail.com
The EIP binding code assumes ec2 URLs and the stack you have provided hints that the specified URLs via the property: eureka.serviceUrl.<zone/default> is not a typical ec2 IP like the code here assumes:


Feel free to file an issue providing the issue detail and I will fix it to fail gracefully instead of a StringIndexOutOfBoundsException. 
As per the impact of this error, eureka server will not be able to bind to an EIP if configured.
Reply all
Reply to author
Forward
0 new messages