Customising handling of JupyterHub 50x errors

29 views
Skip to first unread message

Norman Gray

unread,
Feb 7, 2018, 9:59:04 AM2/7/18
to jup...@googlegroups.com

Greetings.

Is there a way of customising the JupyterHub 50x response(s), or
otherwise handling such problems differently?

Specifically, sometimes a user is unable to log in because their home
directory is missing, or they're out of quota. That results in an error
which is fixable, in the sense there's a next step they can take (clear
some files; talk to the sysadmin), but the actual appearance is an
end-of-the-world 'server's crashed' error.

I've looked through the notes at http://jupyterhub.readthedocs.io/ but
can't see anything which indicates how I might step in at this point.
Can someone give me a pointer?

I'm running JupyterHub 0.8.0.

Best wishes,

Norman


--
Norman Gray : https://nxg.me.uk

Matthias Bussonnier

unread,
Feb 7, 2018, 11:59:54 AM2/7/18
to jup...@googlegroups.com
Hello Norman,

JupyterHub seem to take a `c.JupyterHub.template_paths` config options to configure where templates are searched. If your configuration is a .py file you should be apple to use `.append()` /`.prepend()` to add search path. Then you can provide your own templates for 500 errors (which I believe is error.html).  

Does that help?

Thanks, 
-- 
Matthias


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/9C854046-E0FC-41B8-A78B-F42B71E86FFE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Norman Gray

unread,
Feb 7, 2018, 2:01:02 PM2/7/18
to Project Jupyter

Matthias, hello.


On Wednesday, 7 February 2018 16:59:54 UTC, Matthias Bussonnier wrote:
Hello Norman,

JupyterHub seem to take a `c.JupyterHub.template_paths` config options to configure where templates are searched. If your configuration is a .py file you should be apple to use `.append()` /`.prepend()` to add search path. Then you can provide your own templates for 500 errors (which I believe is error.html).  

That's very useful -- thanks.

I think I'd like to be able to insert a handler for that error a little further down, so I could check for likely problems and give more specific advice to a user, but I don't want to start hacking away at internals if that sort of plugin/overriding isn't supported.

Customising that error file will get me at least half way to where I want to be.

Best wishes,

Norman

Matthias Bussonnier

unread,
Feb 7, 2018, 2:37:09 PM2/7/18
to jup...@googlegroups.com
If you have some specific use case where you want more fine-grained control feel free to open an issue on JupyterHub. 
We can consider the complexity of doing so and the advantage for users. 
I don't know enough about the internal to tell you how feasible that is, but opening an issue or sending a PR is the best way to ensure something like that get implemented. 
-- 
Matthias

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages