question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redis hostname gets a `]` at the end

See original GitHub issue

Expected behavior

Connects to Redis on AWS

Actual behavior

Netty throws an exception trying to resolve the hostname:

Caused by: io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Search domain query failed. Original hostname: 'ec2-54-234-206-155.compute-1.amazonaws.com]' failed to resolve 'ec2-54-234-206-155.compute-1.amazonaws.com].ec2.internal' after 3 queries

Somehow, there is a ] added to the hostname (ec2-54-234-206-155.compute-1.amazonaws.com]), even though my redisson.json does not contain one.

Steps to reproduce or test case

Click this button to deploy the repro example for free on Heroku:

Deploy to Heroku

Then view the logs (you may need to restart the app if you want to view the logs in the browser because it crashes).

Or you may run this sample app with a command like:

$ java -jar webapp-runner.jar --session-store redis --session-store-pool-size 5 target/heroku-redisson-test.war

Redis version

5.0

Redisson version

3.11.4 (appeared in 3.11.01 and possibly earlier but not before 3.10.0)

Redisson configuration

{"singleServerConfig":{"idleConnectionTimeout":10000,"pingTimeout":1000,"connectTimeout":10000,"timeout":5000,"retryAttempts":3,"retryInterval":1500,"password":"pb9e2626905755078bb5c0fa4d482a19e5871b66645aac0c8650794d3c6e742f2","subscriptionsPerConnection":5,"sslEnableEndpointIdentification":true,"sslProvider":"JDK","
pingConnectionInterval":0,"keepAlive":false,"tcpNoDelay":false,"address":"redis://<redacted>:<redacted>@ec2-54-234-206-155.compute-1.amazonaws.com:15319","subscriptionConnectionMinimumIdleSize":1,"subscriptionConnectionPoolSize":50,"connectionMinimumIdleSize":5,"connectionPoolSize":5,"database":0,"dnsMonitoringInterval
":5000},"threads":16,"nettyThreads":32,"codec":{"class":"org.redisson.codec.FstCodec"},"referenceEnabled":true,"transportMode":"NIO","lockWatchdogTimeout":30000,"keepPubSubOrder":true,"decodeInExecutor":false,"useScriptCache":false,"minCleanUpDelay":5,"maxCleanUpDelay":1800,"addressResolverGroupFactory":{"class":"org.redisson.connection.DnsAddressResolverGroupFa
ctory"}}

Other information

Tomcat 8.5.47

The source code for the webapp-runner code that sets up Redisson can be found on Github.

Full error:

SEVERE: The session manager failed to start
org.apache.catalina.LifecycleException: io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Search domain query failed. Original hostname: 'ec2-34-226-17-251.compute-1.amazonaws.com]' failed to resolve 'ec2-34-226-17-251.compute-1.amazonaws.com].ec2.internal' after 3 queries
	at org.redisson.tomcat.RedissonSessionManager.buildClient(RedissonSessionManager.java:354)
	at org.redisson.tomcat.RedissonSessionManager.startInternal(RedissonSessionManager.java:237)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5182)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Search domain query failed. Original hostname: 'ec2-34-226-17-251.compute-1.amazonaws.com]' failed to resolve 'ec2-34-226-17-251.compute-1.amazonaws.com].ec2.internal' after 3 queries
	at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:925)
	at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:884)
	at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:356)
	at io.netty.resolver.dns.DnsResolveContext.onResponse(DnsResolveContext.java:543)
	at io.netty.resolver.dns.DnsResolveContext.access$400(DnsResolveContext.java:64)
	at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:400)
	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:570)
	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:549)
	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490)
	at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615)
	at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:604)
	at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104)
	at io.netty.resolver.dns.DnsQueryContext.setSuccess(DnsQueryContext.java:204)
	at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:196)
	at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:1320)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931)
	at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:93)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514)
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	... 1 more

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mrnikocommented, Oct 20, 2019

Fixed

0reactions
jkutnercommented, Oct 20, 2019

@mrniko oh! i just noticed your commit. thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis CLI
The Redis command line interface ( redis-cli ) is a terminal program used to send commands to and read replies from the Redis...
Read more >
Redis Host Name Hosted on Google Compute Engine
Simply SSH'ed into my VM and used hostname command to retrieve the hostname used on GCP.
Read more >
Configuring Redis - GitLab Docs
Currently the only way to enable hostnames in Redis is by setting redis['announce_ip'] . However, this would need to be set uniquely per...
Read more >
Finding connection endpoints - Amazon ElastiCache for Redis
Redis (cluster mode disabled) clusters, use the Primary Endpoint for all write operations. Use the Reader Endpoint to evenly split incoming ...
Read more >
Azure Redis Reference - VMware Docs
REDIS -HOSTNAME is the hostname or IP address of the exposed Redis endpoint used by clients to connect to the service. REDIS-TLS-PORT is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found