Description
The analytics situational test I added that restarts the couchbase service fails consistently with an assertion in the lcb json library
/home/***/jenkins/workspace/c-cpp/lcb/qe-situational-lcb/lib***/contrib/lcb-jsoncpp/lcb-jsoncpp.cpp:2366: void Json::throwLogicError(const string&): Assertion `false' failed.
After investigating, the analytics service is returning a 503 error with a plaintext body of "503 Service Unavailable" at the moment the service is restarted (possible a separate issue).
lcb_ANALYTICS_HANDLE_::invoke_row does not check the content type so tries to decode it as json. "503 Service Unavailable" should be invalid JSON
jakerawsthorne@REML0715 libcouchbase % node
Welcome to Node.js v14.10.0.
Type ".help" for more information.
> JSON.parse("503 Service Unavailable")
Uncaught SyntaxError: Unexpected token S in JSON at position 4
however lcb-jsoncpp parses it as the number 503. Failing test case: http://review.couchbase.org/c/libcouchbase/+/160062
When invoke_row calls const Json::Value &errors = meta["errors"]; the assertion is hit because you can't index into a number
Attachments
Issue Links
- relates to
-
MB-48154 Analytics server returns errors as plain text instead of JSON
-
- Closed
-
Activity
Status | New [ 10003 ] | Open [ 1 ] |
Fix Version/s | 3.2.2 [ 17647 ] |
Link | This issue relates to CBD-4306 [ CBD-4306 ] |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] | |
Status | Resolved [ 5 ] | Reopened [ 4 ] |
Resolution | Fixed [ 1 ] | |
Status | Reopened [ 4 ] | Resolved [ 5 ] |
Thanks for reporting this issue, I've opened ticket for MB to clarify this behaviour. Meanwhile I will make sure that bad JSON response will not break response handlers of HTTP services inside libcouchbase.