Couchbase Unknown host in bootstrap list

I have a cluster of 2 machine and when I start my service that makes the connection log to me as the following error:

[PORTAL] 776296 [http-bio-9090-exec-63] INFO  com.couchbase.client.core.CouchbaseCore  - CouchbaseEnvironment: {sslEnabled=false, sslKeystoreFile='null', sslKeystorePassword='null', queryEnabled=false, queryPort=8093, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=3, computationPoolSize=3, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=1, queryServiceEndpoints=1, searchServiceEndpoints=1, ioPool=NioEventLoopGroup, coreScheduler=CoreScheduler, eventBus=DefaultEventBus, packageNameAndVersion=couchbase-java-client/2.2.7 (git: 2.2.7, core: 1.2.8), dcpEnabled=false, retryStrategy=BestEffort, maxRequestLifetime=180000, retryDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=100, upper=100000}, reconnectDelay=ExponentialDelay{growBy 1.0 MILLISECONDS, powers of 2; lower=32, upper=4096}, observeIntervalDelay=ExponentialDelay{growBy 1.0 MICROSECONDS, powers of 2; lower=10, upper=100000}, keepAliveInterval=30000, autoreleaseAfter=2000, bufferPoolingEnabled=true, tcpNodelayEnabled=true, mutationTokensEnabled=false, socketConnectTimeout=1000, dcpConnectionBufferSize=20971520, dcpConnectionBufferAckThreshold=0.2, dcpConnectionName=dcp/core-io, callbacksOnIoPool=false, queryTimeout=180000, viewTimeout=75000, kvTimeout=2500, connectTimeout=5000, disconnectTimeout=25000, dnsSrvEnabled=false}
[PORTAL] 776367 [http-bio-9090-exec-63] INFO  com.couchbase.client.core.message.cluster.SeedNodesRequest  - Unknown host  couchbaseServer2.xxx in bootstrap list.
java.net.UnknownHostException:  couchbaseServer2.xxx
	at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1295)
	at java.net.InetAddress.getAllByName0(InetAddress.java:1248)
	at java.net.InetAddress.getAllByName(InetAddress.java:1164)
	at java.net.InetAddress.getAllByName(InetAddress.java:1098)
	at java.net.InetAddress.getByName(InetAddress.java:1048)
	at com.couchbase.client.core.message.cluster.SeedNodesRequest.<init>(SeedNodesRequest.java:99)
	at com.couchbase.client.java.CouchbaseAsyncCluster.<init>(CouchbaseAsyncCluster.java:264)
	at com.couchbase.client.java.CouchbaseCluster.<init>(CouchbaseCluster.java:234)
	at com.couchbase.client.java.CouchbaseCluster.create(CouchbaseCluster.java:191)
	at com.couchbase.client.java.CouchbaseCluster.create(CouchbaseCluster.java:179)

after this error log write :

[PORTAL] 776625 [cb-io-1-1] INFO  com.couchbase.client.core.node.Node  - Connected to Node couchbaseServer1.xxx
[PORTAL] 776948 [cb-computations-3] INFO  com.couchbase.client.core.config.ConfigurationProvider  - Opened bucket test_bucket
[PORTAL] 776984 [cb-io-1-2] INFO  com.couchbase.client.core.node.Node  - couchbaseServer2.xxx

Hi @Alessandro.79,

Are you writing Java and using the Couchbase Java SDK? It looks like you’re trying to connect to couchbaseServer2.xxx, and that host is unable to be found. Are you sure that’s a correct host name?

i write in java and using a java sdk (java-client-2.2.7.jar)
i using a cluster of 2 server node with url :
couchbase01.xx,couchbase02.xxx
and i use:

protected static final CouchbaseEnvironment ENV = DefaultCouchbaseEnvironment
			.builder().maxRequestLifetime(ENV_TIME_OUT).queryTimeout(ENV_TIME_OUT).build(); 
cluster = CouchbaseCluster.create(ENV, url);

when url is couchbase01.xx,couchbase02.xxx

1 Like

@Alessandro.79 the log is unambiguous. Your application is trying to lookup the ip address of couchbase02.xxx and the address resolver is not able to find it.

If you’re able to connect in other ways to couchbase02.xxx, you’ll need to look at how java.net resolves hostnames on your system. This has nothing to do with Couchbase directly, so if you need to diagnose the problem you might want to write a simple Java app that just calls java.net.InetAddress.getByName directly.

2 Likes