I have an instance of JupyterHub deployed using ODH (Open Data Hub). The pods were running fine from past couple of months but suddenly since last two days the pods have started getting Restarted automatically. The errors which I am able to see from the previous logs of the container are:
[C 2022-09-13 05:09:29.959 JupyterHub app:2937] Received signal SIGTERM, initiating shutdown...
[I 2022-09-13 05:09:29.960 JupyterHub app:2573] Cleaning up 2 services...
[E 2022-09-13 05:09:49.269 JupyterHub ioloop:761] Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7f876c08af98>>, <Task finished coro=<JupyterHub.check_services_health() done, defined at /opt/app-root/lib/python3.6/site-packages/jupyterhub/app.py:2090> exception=AttributeError("'NoneType' object has no attribute 'proto'",)>)
Traceback (most recent call last):
File "/opt/app-root/lib/python3.6/site-packages/tornado/ioloop.py", line 741, in _run_callback
ret = callback()
File "/opt/app-root/lib/python3.6/site-packages/tornado/ioloop.py", line 765, in _discard_future_result
future.result()
File "/opt/app-root/lib/python3.6/site-packages/jupyterhub/app.py", line 2096, in check_services_health
await Server.from_orm(service.orm.server).wait_up(timeout=1)
File "/opt/app-root/lib/python3.6/site-packages/jupyterhub/objects.py", line 116, in from_orm
return cls(orm_server=orm_server)
File "/opt/app-root/lib/python3.6/site-packages/traitlets/traitlets.py", line 1000, in __init__
super_kwargs[key] = value
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/contextlib.py", line 88, in __exit__
next(self.gen)
File "/opt/app-root/lib/python3.6/site-packages/traitlets/traitlets.py", line 1131, in hold_trait_notifications
self.notify_change(change)
File "/opt/app-root/lib/python3.6/site-packages/traitlets/traitlets.py", line 1176, in notify_change
c(change)
File "/opt/app-root/lib/python3.6/site-packages/jupyterhub/objects.py", line 131, in _orm_server_changed
self.proto = obj.proto
AttributeError: 'NoneType' object has no attribute 'proto'
I have also attached the complete log file of the container for reference.
Can anyone please help me in resolving this issue as a lot of users are facing problems due to this.
JupyterHub 1.4.2 is from a pretty long time ago. There’s a good chance the logged error is a bug that’s been fixed. But as far as I can see, this error is only occurring while the Hub is shutting down, so shouldn’t have any consequences while the Hub is running.
This bit means that something external is killing JupyterHub. Maybe an Out-of-Memory killer? I don’t think it is anything in JupyterHub itself, which is just shutting down because something else told it to.
The Jupyterhub is shutting down on its own without any external event and that seems to be very unusual as this was working for more than a year till now.
I don’t know how to debug what’s sending SIGTERM, since it’s not part of JupyterHub, but it is external to JupyterHub. The logs here show that something is sending JupyterHub SIGTERM, which is ultimately what’s responsible for it shutting down, following the instruction it’s been given. Figuring out what’s sending SIGTERM to JupyterHub is the crux here.