Describe the bug Microservice A trying to register itself to eureka server by using docker network alias. Both the containers are in same network. However, getting below error in Microservice A logs.

@version:1 time::17:32:15.640 threadName:[DiscoveryClient-InstanceInfoReplicator-0] message::17:32:15.640 [DiscoveryClient-InstanceInfoReplicator-0] WARN - Request execution failed with message: java.lang.IllegalArgumentException: Host name may not be null logLevel:WARN msg: - Request execution failed with message: java.lang.IllegalArgumentException: Host name may not be null @timestamp:Aug 19, 2020 @ 23:02:15.644 traceId: _id:3YnHB3QBoVP42Z5TTHQE _type:_doc _index:ebs-jwt _score: - @version:1 time::17:32:15.639 threadName:[DiscoveryClient-InstanceInfoReplicator-0] message::17:32:15.639 [DiscoveryClient-InstanceInfoReplicator-0] ERROR - Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://ebs_eureka_server:8080/eureka/} com.sun.jersey.api.client.ClientHandlerException: java.lang.IllegalArgumentException: Host name may not be null at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123) at

Sample Microservice A application.yml

spring: application: name: A eureka: client: service-url: defaultZone: http://ebs_eureka_server:8080/eureka

Eureka Server application.yml

eureka: client: register-with-eureka: false fetch-registry: false service-url: defaultZone: http://localhost:8080/eureka/

When I used hosting machine IP with eureka server container port exposed as 8080:8080 then microservice A is able to register.

Comment From: mayankvaid88

issue seems to be due to underscore present in the URL which is not possible for a url to have. Hence, parsing fails to determine the service name