Timeout for basic bucket query

I’m trying to use the Java SDK (v2.1.3) to write a simple query against an instance of Couchbase Server (v3.0.1 Community) but no matter what I try, it always times out with the following exception

java.util.concurrent.TimeoutException
at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:93)
at com.couchbase.client.java.CouchbaseBucket.query(CouchbaseBucket.java:510)

At this point, I’m just trying to query the sample data to get something working but it still times out. I referenced the code in the tutorial at http://docs.couchbase.com/developer/java-2.1/tutorial.html. The code I’m using is

CouchbaseCluster cluster = CouchbaseCluster.create(myServerAddress);
Bucket bucket = cluster.openBucket(“beer-sample”, 2, TimeUnit.MINUTES);

ViewResult result = bucket.query(ViewQuery.from(“beer”, “by_name”).limit(1), 2, TimeUnit.MINUTES);

Any ideas am I doing wrong? The view works fine from the web console. I feel like I’m missing something simple.

I appreciate any help.

Bill

@Foosh thanks for trying out the java SDK!

To help you further, can you enable TRACE level logging with your favourite logging framework and share those logs? Since they also include the network traffic, we might be able to find out what’s going on. Also, it looks like the query method times out, did you make sure that ports 8092 and for 4.0 8093 are reachable in addition to 11210?

Thanks for the response @daschl! I enabled TRACE level logging and here’s an excerpt from the log when I try the query.

19,075 WARN [cb-io-1-7] com.couchbase.client.core.endpoint.Endpoint: [null][ViewEndpoint]: Could not connect to endpoint, retrying with delay 32 MILLISECONDS:
com.couchbase.client.deps.io.netty.channel.ConnectTimeoutException: connection timed out: /172.30.0.249:8092
at com.couchbase.client.deps.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:212)
at com.couchbase.client.deps.io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
at com.couchbase.client.deps.io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:123)
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:722)
2015-06-23 23:53:19,075 WARN [cb-io-1-6] com.couchbase.client.core.endpoint.Endpoint: [null][KeyValueEndpoint]: Could not connect to endpoint, retrying with delay 32 MILLISECONDS:
com.couchbase.client.deps.io.netty.channel.ConnectTimeoutException: connection timed out: /172.30.0.249:11210
at com.couchbase.client.deps.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:212)
at com.couchbase.client.deps.io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
at com.couchbase.client.deps.io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:123)
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:722)
2015-06-23 23:53:19,075 DEBUG [cb-core-3-1] com.couchbase.client.core.config.ConfigurationProvider: Received signal for outdated configuration.
2015-06-23 23:53:19,075 TRACE [cb-io-1-7] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0x04878467] CLOSE()
2015-06-23 23:53:19,076 TRACE [cb-io-1-6] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0x05f572f3] CLOSE()
2015-06-23 23:53:19,076 DEBUG [cb-core-3-1] com.couchbase.client.core.config.ConfigurationProvider: Received signal for outdated configuration.
2015-06-23 23:53:19,076 TRACE [cb-io-1-7] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0x04878467] UNREGISTERED
2015-06-23 23:53:19,077 TRACE [cb-io-1-6] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0x05f572f3] UNREGISTERED
2015-06-23 23:53:19,078 TRACE [cb-io-1-6] com.couchbase.client.core.endpoint.AbstractGenericHandler: [null][KeyValueEndpoint]: Not cancelling operations - sent queue is empty.
2015-06-23 23:53:19,078 TRACE [cb-io-1-7] com.couchbase.client.core.endpoint.AbstractGenericHandler: [null][ViewEndpoint]: Not cancelling operations - sent queue is empty.
2015-06-23 23:53:19,109 TRACE [cb-io-1-1] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0xa981c725] REGISTERED
2015-06-23 23:53:19,109 TRACE [cb-io-1-8] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0x03479994] REGISTERED
2015-06-23 23:53:19,109 TRACE [cb-io-1-1] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0xa981c725] CONNECT(/172.30.0.249:8092, null)
2015-06-23 23:53:19,109 TRACE [cb-io-1-8] com.couchbase.client.deps.io.netty.handler.logging.LoggingHandler: [id: 0x03479994] CONNECT(/172.30.0.249:11210, null)

Can you make sure 11210, 8091-8093 (inclusive) are reachable from your host? The SDK wants to connect to this server, but it gets ConnectTimeoutExceptions.

I double checked and those ports are all reachable. Any other ideas?

We still can’t seem to get this working. The ports are reachable but we’re getting the same exception. Are there any other settings we can check?

Thanks!
Bill

@Foosh can you upload the full TRACE log somewhere?

Sure, here’s a gist containing the full TRACE log. I appreciate the help!

@Foosh hmm that doesn’t include what I was looking for (especially the TRACE logs during bootstrap, which include environment info, as well as raw info of the config that is received from the server). I was hoping to get more context out of it - do you think you can get me that as well? If you prefer, you can also reach me through private channels (you can also DM me here in discourse)