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