# ERROR Should have exactly one hook registered

**URL:** <https://community.learningequality.org/t/error-should-have-exactly-one-hook-registered/1439>\
**Category:** Kolibri\
**Created:** [February 18, 2020, 12:25pm UTC](https://community.learningequality.org/t/error-should-have-exactly-one-hook-registered/1439 "2020-02-18T12:25:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffg](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jeffg](https://community.learningequality.org/u/jeffg)\
**Post date:** [February 18, 2020, 12:25pm UTC](https://community.learningequality.org/t/error-should-have-exactly-one-hook-registered/1439/1 "2020-02-18T12:25:00Z")

</div>

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 [http://127.0.0.1:8080](http://127.0.0.1:8080), 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:

```
http://127.0.0.1:8080/
http://172.16.240.1:8080/
http://192.168.200.1:8080/
http://192.168.43.110:8080/

```

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 Bus STARTING  
INFO ENGINE Serving on [http://0.0.0.0:8080](http://0.0.0.0:8080)  
INFO ENGINE Bus STARTED  
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/exception.py”,  
line 41, in inner  
response = get\_response(request)  
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/handlers/base.py”, line  
187, in \_get\_response  
response = self.process\_exception\_by\_middleware(e, request)  
File “/usr/lib/python3/dist-packages/kolibri/dist/django/core/handlers/base.py”, line  
185, in \_get\_response  
response = wrapped\_callback(request, \*callback\_args, \*\*callback\_kwargs)  
File “/usr/lib/python3/dist-packages/kolibri/dist/django/views/generic/base.py”, line  
68, in view  
return self.dispatch(request, \*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/kolibri/dist/django/utils/decorators.py”, line 67  
, in \_wrapper  
return bound\_func(\*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/kolibri/dist/django/views/decorators/http.py”, 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/decorators.py”, line 325, in calcula  
te\_spa\_etag  
+ str(ThemeHook().cacheKey).encode(“utf-8”)  
File “/usr/lib/python3/dist-packages/kolibri/plugins/hooks.py”, line 220, in inner  
return func(instance, \*args, \*\*kwargs)  
File “/usr/lib/python3/dist-packages/kolibri/core/theme\_hook.py”, line 129, in cacheKe  
y  
theme = list(self.registered\_hooks)[0].theme  
IndexError: list index out of range

---

<div class="post-metadata">

**Author:** ![devon](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/devon/32/481_2.png) [@devon](https://community.learningequality.org/u/devon)\
**Post date:** [February 18, 2020, 5:08pm UTC](https://community.learningequality.org/t/error-should-have-exactly-one-hook-registered/1439/2 "2020-02-18T17:08:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jeffg](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jeffg](https://community.learningequality.org/u/jeffg)\
**Post date:** [February 19, 2020, 7:47am UTC](https://community.learningequality.org/t/error-should-have-exactly-one-hook-registered/1439/3 "2020-02-19T07:47:14Z")

</div>

settings.json:

{  
“AUTO\_SEARCH\_PLUGINS”: [],  
“DISABLED\_APPS”: [],  
“FIRST\_RUN”: false,  
“INSTALLED\_APPS”: [  
“kolibri.plugins.learn”,  
“kolibri.plugins.media\_player”,  
“kolibri.plugins.document\_pdf\_render”,  
“kolibri.plugins.style\_guide”,  
“kolibri.plugins.coach”,  
“kolibri\_exercise\_perseus\_plugin”,  
“kolibri.plugins.html5\_app\_renderer”,  
“kolibri.plugins.user”,  
“kolibri.plugins.setup\_wizard”  
]  
}

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)…

---

<div class="post-metadata">

**Author:** ![jeffg](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jeffg](https://community.learningequality.org/u/jeffg)\
**Post date:** [February 19, 2020, 11:28am UTC](https://community.learningequality.org/t/error-should-have-exactly-one-hook-registered/1439/4 "2020-02-19T11:28:02Z")

</div>

Devon, thanks for the clue. I compared this file to the one on my RPI (still running) and discovered 4 lines different:  
“kolibri.plugins.default\_theme”,  
“kolibri.plugins.style\_guide”,  
“kolibri.plugins.facility\_management”,  
“kolibri.plugins.device\_management”   
after adding them, the problem went away. The question is how they got removed…

---

<div class="post-metadata">

**Author:** ![devon](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.learningequality.org/devon/32/481_2.png) [@devon](https://community.learningequality.org/u/devon)\
**Post date:** [February 19, 2020, 6:47pm UTC](https://community.learningequality.org/t/error-should-have-exactly-one-hook-registered/1439/5 "2020-02-19T18:47:36Z")

</div>

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.
