Provide more detailed error message in case of version mismatch

this is the most likely cause of redirect loops when using docker,
so record the spawner version and check it when a redirect is detected.

In the event of a redirect and mismatch, fail with a message explaining the version mismatch and how to fix it.
This commit is contained in:
Min RK
2017-08-26 22:38:50 -04:00
parent e1531ec277
commit 447edd081a
4 changed files with 30 additions and 6 deletions

View File

@@ -472,6 +472,9 @@ class User(HasTraits):
else:
server_version = resp.headers.get('X-JupyterHub-Version')
_check_version(__version__, server_version, self.log)
# record the Spawner version for better error messages
# if it doesn't work
spawner._jupyterhub_version = server_version
finally:
spawner._waiting_for_response = False
spawner._start_pending = False