Skip to content
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

Connecting to server from notebooks-ui during spawn results in 500 #41

Closed
leafty opened this issue Sep 5, 2018 · 9 comments
Closed
Labels
bug Something isn't working

Comments

@leafty
Copy link
Member

leafty commented Sep 5, 2018

Clicking on Connect while the server is not ready results in a 500 page on jupyterhub.

@rokroskar rokroskar added the bug Something isn't working label Sep 5, 2018
@rokroskar rokroskar added this to the 0.2.1 milestone Sep 5, 2018
@ebiiii
Copy link

ebiiii commented Sep 7, 2018

Maybe this is the cause:

[2018-09-07 05:29:46 +0000] [8] [ERROR] Error handling request /jupyterhub/services/notebooks/eberlej/test-renku/b408a9cd335cb122eef4ae3bc0507f19c9ae6905/test.ipynb
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base_async.py", line 56, in handle
    self.handle_request(listener_name, req, client, addr)
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/ggevent.py", line 160, in handle_request
    addr)
  File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base_async.py", line 107, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/app/src/notebooks_service.py", line 91, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/app/src/notebooks_service.py", line 136, in decorated
    return f(user, *args, **kwargs)
  File "/app/src/notebooks_service.py", line 233, in notebook_status
    app.logger.debug(request.environ['HTTP_REFERER'])
KeyError: 'HTTP_REFERER'

@rokroskar
Copy link
Member

That should've been fixed, where are you running it? This only happens when you enter the url manually

@rokroskar
Copy link
Member

I think the reason is that JH returns a 400 somewhere that isn't being handled properly

@leafty
Copy link
Member Author

leafty commented Sep 7, 2018

Just to say, this is low priority imho. It's quite rare to click on connect while the server is spawning.

@rokroskar
Copy link
Member

sure, but to clarify -- you clicked connect in the "notebook UI" where it lists the running servers, right? That whole setup needs to be fixed, but yes, I think I've also encountered it there.

@leafty
Copy link
Member Author

leafty commented Sep 7, 2018

yep

@rokroskar
Copy link
Member

rokroskar commented Sep 7, 2018

For some reason, JH tries to spawn the server again when you try to connect:

[I 2018-09-07 08:22:49.155 JupyterHub log:158] 302 GET /jupyterhub/user/rokroskar/rokroskar-test-567e45d/ -> /jupyterhub/hub/user/rokroskar/rokroskar-test-567e45d/ (@10.39.0.0) 1.25ms
[D 2018-09-07 08:22:49.203 JupyterHub base:603] Initiating spawn for rokroskar
[D 2018-09-07 08:22:49.203 JupyterHub base:609] 1/64 concurrent spawns
[D 2018-09-07 08:22:49.203 JupyterHub base:612] 1 active servers
[I 2018-09-07 08:22:49.282 JupyterHub spawners:84] starting with args: --ip="0.0.0.0" --port=8888 --notebook-dir="/home/jovyan/work" --NotebookApp.default_url="/lab" --debug
[D 2018-09-07 08:22:49.282 JupyterHub spawners:86] user options: {}

This second spawn is after the first spawn is underway. Note the empty user_options - that's what ultimately causes a 500 because the RenkuSpawner expects a commit_sha in the user_options. This is what they look like on the first spawn:

[D 2018-09-07 08:22:46.157 JupyterHub spawners:86] user options: {'branch': 'master', 'commit_sha': '567e45df39ce2c5ce044339887a8b5fc67eea007', 'namespace': 'rokroskar', 'notebook': None, 'project': 'test', 'image_pull_secrets': ['renku-notebooks-registry']}

Where this second spawn comes from I have no idea. I guess it could happen if JH automatically spawns a new server on a GET but that would be strange (the button on the notebooks UI goes straight to JH and does not go through the notebook service).

@rokroskar
Copy link
Member

Leaving this open but removing it from the 0.3.0 milestone.

@rokroskar rokroskar removed this from the 0.3.0 milestone Nov 26, 2018
@rokroskar
Copy link
Member

I believe it has been fixed with the new UI implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants