[E 2019-09-25 05:16:53.998 JupyterHub web:1788] Uncaught exception GET /hub/user/apoliakevitch/ (10.244.4.1)
HTTPServerRequest(protocol='http', host='conda.corp-apps.com', method='GET', uri='/hub/user/apoliakevitch/', version='HTTP/1.1', remote_ip='10.244.4.1')
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/web.py", line 1699, in _execute
result = await result
File "/usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py", line 1013, in get
raise copy.copy(exc).with_traceback(exc.__traceback__)
File "/usr/local/lib/python3.6/dist-packages/tornado/gen.py", line 589, in error_callback
future.result()
File "/usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py", line 636, in finish_user_spawn
await spawn_future
File "/usr/local/lib/python3.6/dist-packages/jupyterhub/user.py", line 489, in spawn
raise e
File "/usr/local/lib/python3.6/dist-packages/jupyterhub/user.py", line 409, in spawn
url = await gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
File "/usr/local/lib/python3.6/dist-packages/kubespawner/spawner.py", line 1636, in _start
events = self.events
File "/usr/local/lib/python3.6/dist-packages/kubespawner/spawner.py", line 1491, in events
for event in self.event_reflector.events:
File "/usr/local/lib/python3.6/dist-packages/kubespawner/spawner.py", line 72, in events
key=lambda x: x.last_timestamp,
TypeError: '<' not supported between instances of 'datetime.datetime' and 'NoneType'
The patch can be done also by the command below.
@dmpe Change deployment
hub’s.spec.template.spec.containers[0].commandto something like this:As @apoliakevitch says event objects sometimes have null lastTimestamp actually.
So null checking can avoid this problem for the moment.
It is resolved in the 0.9.0-beta.3 though, right?
If the problem is due to a breaking change in the K8s API (as opposed to a bug in kubespawner) the fix will either need to wait for the upstream Python client package (there’s already an open issue: https://github.com/kubernetes-client/python/issues/973) or the fix will need to use methods which haven’t been broken.
If anyone currently running k8s 1.16 has time to investigate that would be very helpful!
I can confirm that this works in version 0.9.0-beta.3
For me the proposed change just changes the error:
Now complains about comparing
floatrather thanNoneType.Great! Would one of you like to open a pull request?
In my case (bare metal installation), I fixed the null problem using the @michitaro patch and the following helm instruction:
If is just to avoid error on sort, maybe should use
datetime.datetime.fromtimestamp(0)rather than just0..You could also use this docker image. It comes with the patch included. Since there’s no pull request yet, I’ll try to open one.