ERROR Should have exactly one hook registered

Kolibri 0.12.8
Ubuntu 18.04
Chrome and Firefox

Had a working instance…using content from a USB key. Worked fine for weeks…

But now, when I do a request, or simply, i get Server Error (500)

I am starting server in foreground, here is output:

kolibri start --foreground
INFO Running Kolibri with the following settings: kolibri.deployment.default.settings.base
INFO Sqlite database Vacuum finished.
INFO Running ‘kolibri start’ in foreground…
INFO Kolibri running on:

INFO Attempting a ping.
INFO Started new JOBCHECKER thread ID#e2b77da9a3f74fe7ada447f303ed0bc4
INFO Updating num_coach_content on existing channels
INFO Sqlite database Vacuum finished.
INFO Next Vacuum at 3AM local server time (in 761.7666666666667 minutes).
INFO Starting Kolibri 0.12.8
INFO Ping succeeded! (response: {‘id’: 620574, ‘messages’: []})
WARNING Ping failed (could not connect). Trying again in 15.0 minutes.
INFO ENGINE Serving on
ERROR Should have exactly one hook registered.

stack trace:
ERROR 2020-02-18 18:25:33,994 hooks Should have exactly one hook registered.
ERROR 2020-02-18 18:25:34,008 exception Internal Server Error: /en/user/
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/handlers/”,
line 41, in inner
response = get_response(request)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/handlers/”, line
187, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/handlers/”, line
185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/views/generic/”, line
68, in view
return self.dispatch(request, *args, **kwargs)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/utils/”, line 67
, in _wrapper
return bound_func(*args, **kwargs)
File “/usr/lib/python3/dist-packages/kolibri/dist/django/views/decorators/”, li
ne 88, in inner
res_etag = etag_func(request, *args, **kwargs) if etag_func else None
File “/usr/lib/python3/dist-packages/kolibri/core/”, line 325, in calcula
+ str(ThemeHook().cacheKey).encode(“utf-8”)
File “/usr/lib/python3/dist-packages/kolibri/plugins/”, line 220, in inner
return func(instance, *args, **kwargs)
File “/usr/lib/python3/dist-packages/kolibri/core/”, line 129, in cacheKe
theme = list(self.registered_hooks)[0].theme
IndexError: list index out of range

Hi @jeffg -

This error seems to indicate that something has changed in your configuration, possibly related to plugins. Have you or anyone else possibly run any kolibri manage ... commands?

Would you mind posting the contents of the file ~/.kolibri/kolibri_settings.json?

Thank you


“FIRST_RUN”: false,

I only starting playing around with manage commands after this problem surfaced. I tried manage listchannels to see if it still recognized my content, and vacuumsqlite just in case (though thats done on start)…

Devon, thanks for the clue. I compared this file to the one on my RPI (still running) and discovered 4 lines different:
after adding them, the problem went away. The question is how they got removed…

Thanks - glad that resolved it.

My guess is that if you were having problems before, it was actually giving a different error. Then some manage command change caused a new issue.

If you’d like, you can look back at your logs from when the problems initially started and check for errors during that time.