Hub Shutdown causes error

Hey guys,
i searched more than a week for solution but didn’t find one. So my problem is that my tljh works fine but the only thing that doesn’t work is if i want to shutdown the hub via admin panel this message pops up: “API request failed (500): Internal Server Error”.
But everything else works fine.

Did anybody find a solution for this problem?

Do you see anything in the Hub logs? There should be a traceback there pointing to the real issue.

Sorry for my late answer.
Where is the file with logs located?

Sorry. The logs can be accessed with:

sudo journalctl -u jupyterhub

relevant docs

Hi,
I’ve copied the log part now and I’ve replaced the specific url with ‘myurl’ for easier readability.

[E 2019-06-11 13:23:26.521 JupyterHub web:1788] Uncaught exception POST /hub/api/shutdown (myip)
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:     HTTPServerRequest(protocol='http', host='myurl:1600', metho
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:     Traceback (most recent call last):
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       File "/opt/tljh/hub/lib/python3.6/site-packages/tornado/web.py", line 1697, in _execute
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:         result = method(*self.path_args, **self.path_kwargs)
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub/utils.py", line 212, in decorated
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:         return method(self, *args, **kwargs)
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub/apihandlers/hub.py", line 29, in post
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:         app = JupyterHub.instance()
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       File "/opt/tljh/hub/lib/python3.6/site-packages/traitlets/config/configurable.py", line 423, in instance
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:         '%s are being created.' % cls.__name__
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:     traitlets.config.configurable.MultipleInstanceError: Multiple incompatible subclass instances of JupyterHu
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:
Jun 11 13:23:26 ip-172-31-24-199 python3[804]: [E 2019-06-11 13:23:26.524 JupyterHub log:150] {
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Host": "myurl:1600",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/7
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Content-Length": "29",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Accept": "application/json, text/javascript, */*; q=0.01",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Accept-Encoding": "gzip, deflate",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Accept-Language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Content-Type": "application/json",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Cookie": "...",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Origin": "myurl:1600",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "Referer": "myurl:1600/hub/admin",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "X-Forwarded-For": "myip",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "X-Forwarded-Host": myurl:1600",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "X-Forwarded-Port": "1600",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "X-Forwarded-Proto": "http",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "X-Forwarded-Server": "myip",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "X-Real-Ip": "myip",
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:       "X-Requested-With": "XMLHttpRequest"
Jun 11 13:23:26 ip-172-31-24-199 python3[804]:     }
Jun 11 13:23:26 ip-172-31-24-199 python3[804]: [E 2019-06-11 13:23:26.525 JupyterHub log:158] 500 POST /hub/api/shutdown (ubuntu@myip) 17.80ms

Hello, could I ask if you ended up finding a solution to this problem? My Hub (using Z2JH) is encountering a similar error where if a user tries to stop a server or generate an API token themselves, it leads to an API request 404 error. However, stopping servers through the admin panel does seem to work.