No index available on keyspace. Fixes after server restart

index

#1

Hi there,
I got this error in my application:

set 22 09:35:52 dataPC httpserver.sh[16466]: HTTPserver: starting service\n
set 22 09:35:53 dataPC httpserver[16469]: Reading configuration file at /etc/dbedataviewer/config.ini
set 22 09:35:53 dataPC httpserver[16469]: getting batch codes
set 22 09:35:53 dataPC httpserver.sh[16466]: Traceback (most recent call last):
set 22 09:35:53 dataPC httpserver.sh[16466]:   File "/usr/local/bin/HttpServer.py", line 38, in <module>
set 22 09:35:53 dataPC httpserver.sh[16466]:     [DD_OPTIONS, DEFAULT_DD_OPTION] = CMANAGER.get_batch_codes()
set 22 09:35:53 dataPC httpserver.sh[16466]:   File "/usr/local/bin/CouchbaseManager.py", line 67, in get_batch_codes
set 22 09:35:53 dataPC httpserver.sh[16466]:     for code in batch_codes:
set 22 09:35:53 dataPC httpserver.sh[16466]:   File "/home/decibel/.local/lib/python3.5/site-packages/couchbase/n1ql.py", line 474, in __iter__
set 22 09:35:53 dataPC httpserver.sh[16466]:     raw_rows = self.raw.fetch(self._mres)
set 22 09:35:53 dataPC httpserver.sh[16466]: couchbase.exceptions.HTTPError: <RC=0x3B[HTTP Operation failed. Inspect status code for details], HTTP Request failed. Examine 'objextra' for full result, Results=1, C Source=(src/http.c,144), OBJ=ViewResult<rc=0x3B[HTTP Operation failed. Inspect status code for details], value={'errors': [{'msg': 'No index available on keyspace OperationsLog that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online.', 'code': 4000}], 'requestID': 'bc9d76c4-8111-4114-9d13-f248fce2101d', 'status': 'fatal', 'metrics': {'resultCount': 0, 'resultSize': 0, 'errorCount': 1, 'elapsedTime': '466.349µs', 'executionTime': '440.514µs'}}, http_status=404>>
set 22 09:35:53 dataPC httpserver[16469]: Closing database connections
set 22 09:35:57 dataPC httpserver.sh[16466]: Service started\n
set 22 09:35:57 dataPC httpserver.sh[16473]: HTTPserver: stopping Service\n
set 22 09:35:57 dataPC httpserver.sh[16473]: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
set 22 09:35:57 dataPC systemd[1]: Started HttpServer daemon.

weird thing is that:

  • primary index exists
  • after a service restart (it runs on ubuntu) the error disappears and everything works fine

Does someone have any hints?

Thanks in advance!


#2

What version of Couchbase Server are you using?


#3

Hi Matthew, thank you for your answer.

Here it is the version information:
Package: couchbase-server-community
Version: 5.0.1-5003-1

It runs on Ubuntu 16.04.4 LTS as a service.


#4

Hi @mafabio before you restart your service, can you try issuing the query via curl or Query Work Bench and see if you get the right results?

It would be great if you can do a cbcollect and post the log. Right now there is not enough information to figure out the problem


#5

Hi @raju. Thank you for the tips.
Currently the database is not in the situation I described above, and I cannot figure out how to replicate that status. Anyway it happened more than once, so I guess it will do it again.
Thanks to your post, the next time it will happen I will be able to collect more significant information.
I will keep you posted on this.

Bye.