"Error Parsing Failed" after ViewQuery


#1

Hey Couchbase forum,

we are currently using Couchbase 3.0.1 Community Edition with Couchbase Node Library 2.1.3.

We encounter random errors after performing a ViewQuery against the Cluster. (without recognizing any occurrence patterns)
The error message just says: “Error Parsing Failed”

The stacktrace looks like this:

DatabaseError: unknown error : error parsing failed
    at mapError (/app/node_modules/.../lib/couchbase.js:34:12)
    at /app/node_modules/.../lib/couchbase.js:20:15
    at ViewQueryResponse.<anonymous> (/app/node_modules/couchbase/lib/bucket.js:551:7)
    at /app/node_modules/couchbase/lib/bucket.js:521:15

The corresponding code handles the parsing of the error to JSON and prints this message if JSON.parse(error) returns a falsy value. Could somebody elaborate on this?

Thanks
Balgorn


#2

Maybe @brett19 or @nraboy can help you here.


#3

Just encountered this issue too, but got a little more Background to it:

It happens if you put high concurrent load on a couchbase server and are querying a lot of views. A script with 8 Worker Threads, each executing around 30 views in parallel on each ‘run’ leads after a minute max to this issues ( only a restart of the script ‘recovers’ this error ). from a different script and web console the server is always available. We’re talking about a medium sized index and nothing else really happening.

Finally this results in the following Issues:

209239ms [I1] {3984} [DEBUG] (lcbio_mgr - L:271) <127.0.0.1:8092> (HE=0x1deafa0) Received result for I=0x1e7f6d0,C=(nil); E=0x2f
209239ms [I1] {3984} [ERROR] (connection - L:127) <127.0.0.1:8092> (SOCK=0x1e82320) Failed: lcb_err=0x2f, os_errno=99

Additional Info: File Limit is unlimited on Client and Server -> so this won’t kill the request. Also each Worker has only around 60 open Files / Sockets.

Best Regards and Thanks for your Hard Work

/// EDIT: Found the Reason -> ephemeral port reuse. Maybe this could be documented somewhere? It’s quiet important client side.


#4

Any news on this? I’m experimenting the same exact problem, but the error gives no hint on what is happening.

I changed the SDK code in node_modules/couchbase/lib/bucket.js this way:

console.log('query to be run ',   JSON.stringify({spatial: isSpatial,
      ddoc: ddoc, name: name,
      opts: qs.stringify(opts),
      includedocs: includeDocs}));

console.log(JSON.stringify({vt: viewtype, ddoc: ddoc, name: name, q: q, emitter: emitter}));
console.trace(errCode, val);

and got these values:

 query to be run  {"spatial":false,
 "ddoc":"remove",
 "name":"last_check",
 "opts":"startkey=%5B%22REDACTED%22%2C%22opportunity%22%2C0%5D&endkey=%5B%22REDACTED%22%2C%22opportunity%22%2C1425077006024%5D&stale=false",
 "includedocs":false}
 {"vt":"_view","ddoc":"remove","name":"last_check",
 "q":{"startkey":"[\"REDACTED\",\"opportunity\",0]","endkey":"[\"REDACTED\",\"opportunity\",1425077006024]","stale":"false"},"emitter":{"_events":{},"_eventsCount":2}}
 
 Trace: 23 null

what is error 23? What is it trying to parse?

I’m using nodejs 4.4 and Couchbase 4.1


#5

Hey @jacopo_f,

Error 23 indicates that there was a timeout, usually due to network issues. Have you confirmed that your client is able to properly contact Couchbase Server from your application server? Are you able to perform CRUD operations?

Cheers, Brett


#6

Yes, the client contacts the server as the failing operation is only one among many which are succeeding, and the database is on the same machine of the application.

Excluding this problem, I can perform CRUD operations and access the web console.


#7

I updated to couchbase 4.1 and set LCB_LOGLEVEL=5, so this is a more detailed error log:

 979370ms [I0] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x3035e20,IX=0)     Scheduling next timeout for 2500 ms
 979428ms [I9] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x3026c30,IX=0) Scheduling next timeout for 2500 ms
 979474ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 979474ms [I3] {19285} [TRACE] (confmon - L:271) Current provider is CCCP
 979474ms [I3] {19285} [INFO] (cccp - L:110) Re-Issuing CCCP Command on server struct 0x3082fd0 (10.131.2.226:11210)
 979474ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 980023ms [I3] {19285} [TRACE] (confmon - L:292) Start refresh requested
 2016-10-07T16:06:36.545Z - info:  Error: unknown error : error parsing failed
     at /root/project/node_modules/couchbase/lib/bucket.js:509:29
 2016-10-07T16:06:36.546Z - info: sending message to the client for W77319A and entity new_bodybuilderworkshop
 980026ms [I3] {19285} [DEBUG] (ioctx - L:151) <10.131.2.226:8092> (CTX=0x3431390,mgmt/capi) Destroying. PND=1,ENT=0,SORC=1
 980473ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 980473ms [I3] {19285} [TRACE] (confmon - L:271) Current provider is CCCP
 980473ms [I3] {19285} [INFO] (cccp - L:110) Re-Issuing CCCP Command on server struct 0x3082fd0 (10.131.2.226:11210)
 980474ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 980580ms [I3] {19285} [TRACE] (confmon - L:292) Start refresh requested
 2016-10-07T16:06:37.101Z - info:  Error: unknown error : error parsing failed
     at /root/project/node_modules/couchbase/lib/bucket.js:509:29
 2016-10-07T16:06:37.102Z - info: sending message to the client for W77319A and entity opportunity
 980582ms [I3] {19285} [DEBUG] (ioctx - L:151) <10.131.2.226:8092> (CTX=0x36b6ee0,mgmt/capi) Destroying. PND=1,ENT=0,SORC=1
 981474ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 981474ms [I3] {19285} [TRACE] (confmon - L:271) Current provider is CCCP
 981474ms [I3] {19285} [INFO] (cccp - L:110) Re-Issuing CCCP Command on server struct 0x3082fd0 (10.131.2.226:11210)
 981474ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 981870ms [I6] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x310ca60,IX=0) Scheduling next timeout for 2500 ms
 981870ms [I0] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x3035e20,IX=0) Scheduling next timeout for 2500 ms
 981929ms [I9] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x3026c30,IX=0) Scheduling next timeout for 2500 ms
 983420ms [I3] {19285} [TRACE] (confmon - L:292) Start refresh requested
 2016-10-07T16:06:39.942Z - info:  Error: unknown error : error parsing failed
     at /root/project/node_modules/couchbase/lib/bucket.js:509:29
 2016-10-07T16:06:39.943Z - info: sending message to the client for W77319A and entity activitypointer
 983423ms [I3] {19285} [DEBUG] (ioctx - L:151) <10.131.2.226:8092> (CTX=0x36b5b60,mgmt/capi) Destroying. PND=1,ENT=0,SORC=1
 983423ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 983423ms [I3] {19285} [TRACE] (confmon - L:271) Current provider is CCCP
 983423ms [I3] {19285} [INFO] (cccp - L:110) Re-Issuing CCCP Command on server struct 0x3082fd0 (10.131.2.226:11210)
 983424ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 984371ms [I6] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x310ca60,IX=0) Scheduling next timeout for 2500 ms
 984371ms [I0] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x3035e20,IX=0) Scheduling next timeout for 2500 ms
 984429ms [I9] {19285} [DEBUG] (server - L:476) <10.131.2.226:11210> (SRV=0x3026c30,IX=0) Scheduling next timeout for 2500 ms
 985845ms [I3] {19285} [TRACE] (confmon - L:292) Start refresh requested
 985847ms [I3] {19285} [DEBUG] (ioctx - L:151) <10.131.2.226:8092> (CTX=0x3693f40,mgmt/capi) Destroying. PND=1,ENT=0,SORC=1
 985847ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 985847ms [I3] {19285} [TRACE] (confmon - L:271) Current provider is CCCP
 985847ms [I3] {19285} [INFO] (cccp - L:110) Re-Issuing CCCP Command on server struct 0x3082fd0 (10.131.2.226:11210)
 985848ms [I3] {19285} [INFO] (confmon - L:166) Not applying configuration received via CCCP. No changes detected. A.rev=22688, B.rev=22688
 2016-10-07T16:06:42.366Z - info:  Error: unknown error : error parsing failed
     at /root/project/node_modules/couchbase/lib/bucket.js:509:29

can you shed some light on the problem?

Thanks a lot in any case!