question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

kubespawner: pending spawn in loop until urllib3.exceptions.ReadTimeoutError generated

See original GitHub issue

I use jupyter with kubespawner (k8s in azure), when jupyterhub run more than 2 hours, it doesn’t create new pod for logged user. Log:

[I 2018-11-29 08:25:24.998 JupyterHub log:158] 302 GET /user/toupinets/ -> /hub/user/toupinets/ (@10.1.32.66) 0.74ms
[I 2018-11-29 08:25:28.250 JupyterHub base:1012] Pending spawn for toupinets didn't finish in 3.0 seconds
[I 2018-11-29 08:25:28.250 JupyterHub base:1018] toupinets is pending spawn

[W 2018-11-29 08:53:27.810 JupyterHub user:471] toupinets's server failed to start in 600 seconds, giving up
[E 2018-11-29 08:53:28.258 JupyterHub gen:974] Exception in Future <Task finished coro=<BaseHandler.spawn_single_user.<locals>.finish_user_spawn() done, defined at /usr/local/lib/python3.6/dist-packages/jupyterhub/handlers/base.py:619> exception=TimeoutError('Timeout',)> after timeout

… after some time it generate Exception:

[E 2018-11-29 08:59:07.068 JupyterHub gen:974] Exception in Future <Future finished exception=ReadTimeoutError("HTTPSConnectionPool(host='main-370a339f.hcp.southeastasia.azmk8s.io', port=443): Read timed out. (read timeout=None)",)> after timeout

It start work… It is possible to define read timeout for kubernetes service?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
andreitoupinetscommented, Mar 20, 2019

@yvan , because azure load balancer drop connection after ~5min inactivity. Try keepalive, just put into jupyterhub_config.py

import socket
from urllib3 import connection

connection.HTTPConnection.default_socket_options += [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
                                                    (socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 60),
                                                    (socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 60),
                                                    (socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 3)]
0reactions
meeseeksmachinecommented, Feb 25, 2021

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/spawn-failed-timeout-even-when-start-timeout-is-set-to-3600-seconds/8098/2

Read more comments on GitHub >

github_iconTop Results From Across the Web

kubespawner: pending spawn in loop until urllib3.exceptions ...
kubespawner : pending spawn in loop until urllib3.exceptions.ReadTimeoutError generated ... I use jupyter with kubespawner (k8s in azure), when jupyterhub run more ...
Read more >
Spawn failed: Timeout even when start_timeout is set to 3600 ...
I tried this but it's not helping: kubespawner: pending spawn in loop until urllib3.exceptions.ReadTimeoutError generated · Issue #382 ...
Read more >
jupyterhub_config.py - Kubespawner - Read the Docs
A JupyterHub spawner that spawn pods in a Kubernetes Cluster. Each server spawned by a user will have its own KubeSpawner instance. after_pod_created_hook...
Read more >
jupyterhub starts up fine, but unable to spawn a server
check event logs of user image/pod, for example, if you've logged in with admin user then jupyter-admin named pod must be present in...
Read more >
jupyterhub/jupyterhub - Gitter
Yes, KubeSpawner has a timeout for Spawner.start for the time between ... Hello, API request failed (400): [username] is not running (pending: spawn)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found