Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1925

Analytics Index Manager not parsing errors into proper Exceptions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 3.2.6
    • analytics
    • None
    • 1

    Description

      Analytics has changed the error response from text/plain to application/json in CB 7.1 which has caused some Analytics Index Manager errors to throw generic CouchbaseExcpetions instead of the proper named exception; the AnalyticsChunkResponseParser does not appear able to handle the new format.

      The exceptions no longer thrown are: InvalidArgumentException, LinkExistsException, DataverseNotFoundException, LinkNotFoundException.

      Example of errors not being decoded:

      Caused by: com.couchbase.client.core.error.CouchbaseException: Unknown analytics error: 0  Context: {errors=[{code=24034, msg=Cannot find analytics scope with name absentDataverse}], status=errors} {"completed":true,"coreId":"0xdc0b949600000001","errors":[{"additional":{"errors":[{"code":24034,"msg":"Cannot find analytics scope with name absentDataverse"}],"status":"errors"},"code":0,"message":""}],"httpStatus":400,"idempotent":false,"lastDispatchedFrom":"192.168.100.174:61937","lastDispatchedTo":"172.23.111.129:8095","requestId":369,"requestType":"CoreHttpRequest","retried":0,"service":{"method":"DELETE","path":"/analytics/link","type":"analytics"},"timeoutMs":75000,"timings":{"dispatchMicros":159696,"totalDispatchMicros":159696,"totalMicros":160109}}
      

      The analytics json errors now look like this:

      {"errors":[{"code":24034,"msg":"Cannot find analytics scope with name missing_dataverse"}],"status":"errors"}
      

      As far as I can tell, this should not be considered a server bug as this was discussed on MB-50876 , and the error response has now been agreed upon by SDK and Analytics teams.

      Reproducing:
      There are a number of integration tests that fail against 7.1 becuase of this at the moment that you can see here: http://sdk.jenkins.couchbase.com/job/jvm/job/jvm-clients/job/couchbase-jvm-clients-scipted-build-pipeline/1163/testReport/com.couchbase.client.java.manager.analytics/AnalyticsIndexManagerIntegrationTest/

      Test names: createLinkFailsIfAlreadyExists,createLinkFailsIfRequiredPropertyIsMissing, createRemoteLinkFailsIfDataverseNotFound, dropLinkFailsIfDataverseIsNotFound, etc.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            daschl Michael Nitschinger
            will.broadbelt Will Broadbelt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty