Magic numbers returning from n1ql error codes

When creating indexing via nodejs SDK N1qlQuery I’m getting 5000/4300 in case it is already exists.

I guess 5000 is for existing primary index and 4300 is for existing GSI indexing (Could not find documentation for this) and could not find nodejs SDK exporting this.

Hey @aterem,

The list of possible error codes that you can received from a N1QL service is constantly evolving, and we are working on providing a list of possible error codes, but do not quite have it available yet. Perhaps @keshav_m could provide some more details on this.

You can track a relevant issue here:

Cheers, Brett

Thanks @brett19, for responding.
It seems that the issue was created more than a year ago. Do you think it would be possible to share at least a partial and unofficial list of currently known error codes? This will be very helpful.


You are describing MB-19358: n1ql errors on indexing operations should be tightened / expanded, but we currently can’t because n1ql only gets an error string from the indexer.

hi @aterem,

N1QL error codes will be documented in our next refresh (in couple of months). For now, you may refer to code: