-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spawner event stream malfunctions :/ #1501
Spawner event stream malfunctions :/ #1501
Comments
@consideRatio I just tested jupyterhub-0.9.0-alpha.1.060.6698eb9 locally and I get the same error, I got many "Server requested" message. And in the hub pod, this error was occurring many times:
I think the problem is with raw_event object in event ( https://github.com/jupyterhub/kubespawner/blob/0.11.0/kubespawner/spawner.py#L1631). When I comment that line, events work as expected. |
Excellent debugging work!!! Hmm, I dont come up with a clear idea on what we should do to resolve the situation... |
I see the same messages as @bitnik -- nice detective work! |
Hmmm perhaps it relates to using a post-1.0.0 jupyterhub commit, and that this was tested to work with kubespawner only on 1.0.0, so makes the breaking change part of jh perhaps? |
So And I also recently made it test against jupyterhub master, so its not something magically new in jupyterhub master. It simply wasn't covered in the test by kubespawner. import json
from kubernetes.client import V1Event
event = V1Event(involved_object="arne", metadata="kalle")
with open("/tmp/test", "w") as f:
json.dump(e, f)
# results in...
# TypeError: Object of type 'V1Event' is not JSON serializable
# If we on the other hand would do json.dump(e.to_dict(), f)
# that would work! This is required as part of the solution then I figure: https://code-maven.com/serialize-datetime-object-as-json-in-python - we need to make sure nested datetime objects in the V1Event is serializable, already in KubeSpawners spawner.py |
This fixes what was reported in z2jh, where the hub doesn't crash but fails to render the progress properly when it is serializing the events and passing them to the browser to render them. The error we got then was: ``` TypeError: Object of type 'V1Event' is not JSON serializable ``` I think it makes best sense to not require jupyterhub to know about the structure of the content and downstream make this serializable, but instead reaquire all things to be serializable. ref: jupyterhub/zero-to-jupyterhub-k8s#1501
FWIW, I'm still seeing this issue with Relevant part of the log:
|
Thanks, I've verified everything you say to be correct. I visited https://jupyterhub.github.io/helm-chart/ and downloaded the latest helm chart, alpha.1.085, and concluded that its values.yaml indeed used the alpha.1.071 image as could make sense.
We need to use 0.11.1 because the bug is fixed there. The issue is apparently that I've falsely assumed that a requirements with jupyterhub-kubespawner==0.11 would imply ==0.11.* but it didn't, it implied 0.11.0. https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/master/images/hub/requirements.txt#L52 |
The confusion probably comes from You should get the same behaviour with pip using |
Ah, thanks @manics, I'll submit a PR soon! Got stuck fixing ltiauthenticator that had conflicting dependencies. |
Happy to confirm event stream now works for me on v1.16 with the latest Helm chart. Thanks for all the hard work! |
astronomy-commons/genesis-jupyterhub-automator#5
The text was updated successfully, but these errors were encountered: