Random error with the first executed query

Hi,

I’m using the async driver (RxJava) to execute N1QL queries. After my application starts, I randomly face an error.
The error occurs only the first time the query is executed. If I retry it’s always working.
I did’nt reproduced this issue with views and synchronous driver.

Here are the logs from error.log

[stats:error,2016-11-16T23:17:51.670+01:00,ns_1@127.0.0.1:<0.24681.38>:base_stats_collector:handle_info:109](Collector: stats_collector) Exception in stats collector: {exit,
{{error,closed},
{gen_server,
call,
[‘ns_memcached-test’,
{stats,<<>>},
180000]}},
[{gen_server,
call,3,
[{file,
“gen_server.erl”},
{line,188}]},
{ns_memcached,
do_call,3,
[{file,
“src/ns_memcached.erl”},
{line,1433}]},
{stats_collector,
grab_stats,1,
[{file,
“src/stats_collector.erl”},
{line,68}]},
{base_stats_collector,
handle_info,2,
[{file,
“src/base_stats_collector.erl”},
{line,89}]},
{gen_server,
handle_msg,5,
[{file,
“gen_server.erl”},
{line,604}]},
{proc_lib,
init_p_do_apply,
3,
[{file,
“proc_lib.erl”},
{line,239}]}]}

[stats:error,2016-11-16T23:17:51.670+01:00,ns_1@127.0.0.1:<0.17071.38>:base_stats_collector:handle_info:109](Collector: stats_collector) Exception in stats collector: {exit,
{{error,closed},
{gen_server,
call,
[‘ns_memcached-organization’,
{stats,<<>>},
180000]}},
[{gen_server,
call,3,
[{file,
“gen_server.erl”},
{line,188}]},
{ns_memcached,
do_call,3,
[{file,
“src/ns_memcached.erl”},
{line,1433}]},
{stats_collector,
grab_stats,1,
[{file,
“src/stats_collector.erl”},
{line,68}]},
{base_stats_collector,
handle_info,2,
[{file,
“src/base_stats_collector.erl”},
{line,89}]},
{gen_server,
handle_msg,5,
[{file,
“gen_server.erl”},
{line,604}]},
{proc_lib,
init_p_do_apply,
3,
[{file,
“proc_lib.erl”},
{line,239}]}]}

[stats:error,2016-11-16T23:17:51.670+01:00,ns_1@127.0.0.1:<0.16413.38>:base_stats_collector:handle_info:109](Collector: stats_collector) Exception in stats collector: {exit,
{{error,closed},
{gen_server,
call,
[‘ns_memcached-artifact’,
{stats,<<>>},
180000]}},
[{gen_server,
call,3,
[{file,
“gen_server.erl”},
{line,188}]},
{ns_memcached,
do_call,3,
[{file,
“src/ns_memcached.erl”},
{line,1433}]},
{stats_collector,
grab_stats,1,
[{file,
“src/stats_collector.erl”},
{line,68}]},
{base_stats_collector,
handle_info,2,
[{file,
“src/base_stats_collector.erl”},
{line,89}]},
{gen_server,
handle_msg,5,
[{file,
“gen_server.erl”},
{line,604}]},
{proc_lib,
init_p_do_apply,
3,
[{file,
“proc_lib.erl”},
{line,239}]}]}

[stats:error,2016-11-16T23:17:51.670+01:00,ns_1@127.0.0.1:<0.421.0>:base_stats_collector:handle_info:109](Collector: stats_collector) Exception in stats collector: {exit,
{{error,closed},
{gen_server,
call,
[‘ns_memcached-artifacts’,
{stats,<<>>},
180000]}},
[{gen_server,
call,3,
[{file,
“gen_server.erl”},
{line,188}]},
{ns_memcached,
do_call,3,
[{file,
“src/ns_memcached.erl”},
{line,1433}]},
{stats_collector,
grab_stats,1,
[{file,
“src/stats_collector.erl”},
{line,68}]},
{base_stats_collector,
handle_info,2,
[{file,
“src/base_stats_collector.erl”},
{line,89}]},
{gen_server,
handle_msg,5,
[{file,
“gen_server.erl”},
{line,604}]},
{proc_lib,
init_p_do_apply,
3,
[{file,
“proc_lib.erl”},
{line,239}]}]}

[ns_server:error,2016-11-16T23:17:51.873+01:00,ns_1@127.0.0.1:ns_doctor<0.222.0>:ns_doctor:update_status:308]The following buckets became not ready on node ‘ns_1@127.0.0.1’: [“artifact”,
“artifacts”,
“organization”,
“test”], those of them are active [“artifact”,
“artifacts”,
“organization”,
“test”]
[ns_server:error,2016-11-16T23:17:59.670+01:00,ns_1@127.0.0.1:<0.6674.112>:janitor_agent:query_states:186]Failed to query vbucket states from some nodes:
[{‘ns_1@127.0.0.1’,{‘EXIT’,<0.6675.112>,killed}}]
[ns_server:error,2016-11-16T23:18:04.670+01:00,ns_1@127.0.0.1:<0.6765.112>:janitor_agent:query_states:186]Failed to query vbucket states from some nodes:
[{‘ns_1@127.0.0.1’,{‘EXIT’,<0.6738.112>,killed}}]

What do you see at the client? The messages you post above don’t really have much to do with the query. They’re more related to a different kind of failure that would have more info in the other logs.

Just to explain what you’re seeing above, the “stats collector” is a ‘gen_server’ process which is in the cluster manager. In this case, it’s trying to get statistics from the data manager (which goes by the name memcached). At the end, it’s worse in that the cluster manager sees one bucket as not available.

You may want to verify that the correct ports are open between nodes and from the client to the cluster.

Hi,

thanks for the precisions. Actually I remember that my application logged that a connection has been reset but nothing more and now, event when I reproduce the issue (subscribed callbacks never called), nothing appears in the log.