Audit log entry for N1QL SELECT produces error status

I’m trying to diagnose a query failure that seems related to recent recreation of an index. Turing on the audit log for query service, I find the entry for this particular statement and see that the “status” field is “errors” although the “errors” field is null. Why does it say “errors” and can I get more information somewhere (e.g. another log)? If so, how?

{
        "clientContextId": "SOME-UUID",
        "description": "A N1QL SELECT statement was executed",
        "errors": null,
        "id": 28672,
        "requestId": "SOME-OTHER-UUID",
        ...
        "status": "errors",
}

The status is only intended to indicate the overall state, not as an indication if the errors field is populated or not. The details of the error were not recorded as only certain errors are included in the audit logs, notably these:

https://github.com/couchbase/query/blob/1ca7acb23ba8a7c4560ab242024878d9879e0912/audit/audit.go#L741

(Auditing is not intended as a primary diagnostic tool, hence not everything is recorded, only necessary events with necessary details.)

User errors are not logged typically - there could be unmanageable numbers of these (every typo, every repeat in the hope something’s changed, etc.) - they are solely part of the response the individual request receives.

Since you have the user & statement details, could you not just execute the statement to observe the failure & reported error?

Since you have the user & statement details, could you not just execute the statement to observe the failure & reported error?

Yes- I ran the query with the named parameters from the cluster’s query workbench and I was unable to reproduce any error.

As the user in question? (Just in case it is user related, though such errors ought to be included in what is audited.)

Assuming so, it suggests it was a transient issue (whatever it was) and is no longer present.

Regardless, there will be no record of the error the user saw in the system. So unless they reported it and a record was made that way, you will not know what they encountered…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.