opened
kaplan441
username_0
I'm using spring boot admin. My boot admin clients run as docker swarm service.
When I start my client application as container it register to admin server. But when I start client as docker swarm service then register fail.
I tried spring.boot.admin.client.prefer-ip=true but it still.
How can i fix this problem?

`java.lang.IllegalArgumentException: b77cbc25ddfb: b77cbc25ddfb: Temporary failure in name resolution
	at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getLocalHost(DefaultApplicationFactory.java:186) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getServiceHost(DefaultApplicationFactory.java:168) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getServiceBaseUrl(DefaultApplicationFactory.java:103) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getServiceUrl(ServletApplicationFactory.java:63) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at de.codecentric.boot.admin.client.registration.ServletApplicationFactory.getManagementBaseUrl(ServletApplicationFactory.java:76) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getHealthUrl(DefaultApplicationFactory.java:154) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.createApplication(DefaultApplicationFactory.java:80) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at de.codecentric.boot.admin.client.registration.DefaultApplicationRegistrator.register(DefaultApplicationRegistrator.java:56) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
	at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

Caused by: java.net.UnknownHostException: b77cbc25ddfb: b77cbc25ddfb: Temporary failure in name resolution
	at java.base/java.net.InetAddress.getLocalHost(Unknown Source) ~[na:na]
	at de.codecentric.boot.admin.client.registration.DefaultApplicationFactory.getLocalHost(DefaultApplicationFactory.java:183) ~[spring-boot-admin-client-2.3.1.jar:2.3.1]
	... 14 common frames omitted
Caused by: java.net.UnknownHostException: b77cbc25ddfb: Temporary failure in name resolution
	at java.base/java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:na]
	at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(Unknown Source) ~[na:na]
	at java.base/java.net.InetAddress.getAddressesFromNameService(Unknown Source) ~[na:na]
	at java.base/java.net.InetAddress$NameServiceAddresses.get(Unknown Source) ~[na:na]
	at java.base/java.net.InetAddress.getAllByName0(Unknown Source) ~[na:na]
	... 16 common frames omitted`
Client does not register to admin server in docker
issue
created
kaplan441
username_0
Edit: 
 
```
spring:
 boot:
    admin:
      client:
        instance:
          prefer-ip: true
          service-url: http://${HOST_NAME}:${PORT}/
          name: ${APP_NAME}
```
After this addition docker service registered to admin server. But when i increase service instance count( ex: from 1 to 2), only one application registered to admin server(so naturally all instance executed one exposed port)

Can i set docker container id etc information to client, so i see all instance of application in admin server?
comment
created
joshiste
username_1
SBA uses the health url to differentiate the services. Also to check the health of the individual instances we need the individual urls.
comment
closed
joshiste
username_1
issue
created
joshiste
username_1
looks like a general issue and not specific to SBA
comment