Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constantly getting errors when querying views: "The request could not be processed in a reasonable amount of time" #1301

Closed
lokedhs opened this issue Apr 30, 2018 · 1 comment

Comments

@lokedhs
Copy link

lokedhs commented Apr 30, 2018

Current Behavior

On certain databases, every request to a view results in the same error:

{"error":"timeout","reason":"The request could not be processed in a reasonable amount of time.","ref":181479430}

The CouchDB instance contains three databases. Originally, the problem was intermittent but it increased in frequency until every single view request resulted in a timeout.

After dumping the databases and reinstalling CouchDB, everything seemed to work, but after a few hours any view requests on one of the databases again results in the same error. There may be still intermittent errors on the other databases.

Doing a GET on /_active_tasks always returns the empty list.

Relevant messages from the log:

couchdb_1            | [error] 2018-04-30T11:27:45.740408Z nonode@nohost <0.1343.9> 176ec499d3 req_err(181479430) timeout : The request could not be processed in a reasonable amount of time.
couchdb_1            |     [<<"gen_server:call/3 L190">>,<<"couch_query_servers:get_os_process/1 L495">>,<<"couch_query_servers$os_rereduce/3 L134">>,<<"lists:zipwith/3 L449">>,<<"couch_query_servers:rereduce/3 L93">>,<<"fabric_view:get_next_row/1 L232">>$<<"fabric_view:maybe_send_row/1 L128">>,<<"rexi_utils:process_mailbox/6 L55">>]
couchdb_1            | [notice] 2018-04-30T11:27:45.749100Z nonode@nohost <0.1343.9> 176ec499d3 couchdb:5984 172.18.0.10 undefi$ed GET /potato-notification/_design/user/_view/notifications_updated?endkey=%222018-04-30T11%3A27%3A40.730485Z%22 500 ok 5017
couchdb_1            | [error] 2018-04-30T11:27:46.986409Z nonode@nohost emulator -------- Error in process <0.1562.9> with exit value: {database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,403}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,378}]},{mem3_shards,load_shards_from_disk... 
couchdb_1            | [notice] 2018-04-30T11:27:46.986570Z nonode@nohost <0.509.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:403) <= mem3_shards:load_shards_from_disk/1(line:378) <= mem3_shards:load_shards_from_disk/2(line:407) <= mem3_shards:for_docid/3(line:91) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
couchdb_1            | [error] 2018-04-30T11:27:51.758412Z nonode@nohost <0.1502.9> 03a1542fcc req_err(181479430) timeout : The request could not be processed in a reasonable amount of time.
couchdb_1            |     [<<"gen_server:call/3 L190">>,<<"couch_query_servers:get_os_process/1 L495">>,<<"couch_query_servers:os_rereduce/3 L134">>,<<"lists:zipwith/3 L449">>,<<"couch_query_servers:rereduce/3 L93">>,<<"fabric_view:get_next_row/1 L232">>,<<"fabric_view:maybe_send_row/1 L128">>,<<"rexi_utils:process_mailbox/6 L55">>]
couchdb_1            | [notice] 2018-04-30T11:27:51.766405Z nonode@nohost <0.1502.9> 03a1542fcc couchdb:5984 172.18.0.10 undefined GET /potato-notification/_design/user/_view/notifications_updated?endkey=%222018-04-30T11%3A27%3A46.748789Z%22 500 ok 5016


## Steps to Reproduce (for bugs)

I don't have a generic way to reproduce, other than loading the current production database and running our application for a while. I can't share this database, but I'll be happy to run any tests required.

## Your Environment

CouchDB 2.1.1 installed via the official Docker image.
The application used: https://github.com/cicakhq/potato
@wohali
Copy link
Member

wohali commented Apr 30, 2018

Your container needs more CPU. Views are calculated by secondary processes (couchjs) which are not getting enough time to execute on its own.

Allocate more CPU cores to the docker instance.

Duplicate of #1298 #1297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants