Search code examples
wildflyamazon-ecsaws-fargate

Host name resolve error for AWS Fargate task instances


I'm trying to run a dockerized WildFly 26 EE 9.1 preview on a AWS Fargate cluster but it fails to start with

[31m09:15:52,203 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 76) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "webservices")]): java.lang.RuntimeException: java.net.UnknownHostException: 7a0765d6977e48a98e3b16f7533674f7-3378193245: 7a0765d6977e48a98e3b16f7533674f7-3378193245: Name does not resolve
at org.jboss.as.webservices//org.jboss.as.webservices.dmr.WSSubsystemAdd.createServerConfig(WSSubsystemAdd.java:106)
at org.jboss.as.webservices//org.jboss.as.webservices.dmr.WSSubsystemAdd.performBoottime(WSSubsystemAdd.java:93)
at [email protected]//org.jboss.as.controller.AbstractBoottimeAddStepHandler.performBoottime(AbstractBoottimeAddStepHandler.java:144)
at [email protected]//org.jboss.as.controller.AbstractBoottimeAddStepHandler.performRuntime(AbstractBoottimeAddStepHandler.java:119)
at [email protected]//org.jboss.as.controller.AbstractAddStepHandler$1.execute(AbstractAddStepHandler.java:164)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:1045)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:777)
at [email protected]//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:466)
at [email protected]//org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:384)
at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
at java.base/java.lang.Thread.run(Thread.java:831)
at [email protected]//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: java.net.UnknownHostException: 7a0765d6977e48a98e3b16f7533674f7-3378193245: 7a0765d6977e48a98e3b16f7533674f7-3378193245: Name does not resolve
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1644)
at [email protected]//org.jboss.ws.common.management.AbstractServerConfig.setWebServiceHost(AbstractServerConfig.java:133)
at org.jboss.as.webservices//org.jboss.as.webservices.config.ServerConfigImpl.setWebServiceHost(ServerConfigImpl.java:97)
at org.jboss.as.webservices//org.jboss.as.webservices.dmr.WSSubsystemAdd.createServerConfig(WSSubsystemAdd.java:104)
... 14 more
Caused by: java.net.UnknownHostException: 7a0765d6977e48a98e3b16f7533674f7-3378193245: Name does not resolve
at java.base/java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:932)
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1517)
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:851)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1507)
at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1639)

The cluster is deployed in a private subnet but I have a security group that allows all outgoing traffic and all traffic is routed through a NAT Gateway. I recall using the same CloudFormation scripts for WildFly 24:ish and it worked fine so it shouldn't(tm) be a networking issue.

Is the host name generally supposed to be resolvable?


Solution

  • I’m not sure if this issue still persists on your side, but for me it was resolved as soon as I enabled "DNS Hostnames" in VPC ("DNS resolution" was enabled already). I have no idea why this option matters, but even with disabling public IP in Service defintion of ECS the wildfly threw the error. Since the option is enabled (which only seems to enable hostnames for public ips) it is working fine.