-
Notifications
You must be signed in to change notification settings - Fork 2k
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
JUPYTERHUB_SERVICE_PREFIX problem #997
Comments
Thanks @whitead. Do you want to submit a PR or have us make the change? |
Yeah, I can submit a PR but I'm pretty sure my workaround is not the correct fix. if self.url:
env['JUPYTERHUB_SERVICE_URL'] = self.url
env['JUPYTERHUB_SERVICE_PREFIX'] = self.server.base_url where |
Maybe this line in def service_model(service):
"""Produce the model for a service"""
return {
'name': service.name,
'admin': service.admin,
'url': service.url,
'prefix': service.server.base_url if service.server else '',
'command': service.command,
'pid': service.proc.pid if service.proc else 0,
} the |
@whitead you are right that the SERVICE_PREFIX should indeed always end in a slash. The
@validate('base_url')
def _validate_base_url(self, proposal):
"""ensure base_url starts and ends with /"""
value = proposal.value
if not value.startswith('/'):
value = '/' + value
if not value.endswith('/'):
value = value + '/'
return value Looking forward to your PR! |
Thank you for the highly detailed instructions 👍 Your suggestions fix the problem. I've put it into PR #1003. |
Fixes Issue jupyterhub#997. Also updated Traitlets to 4.3.2 since the change in singleuser.py relies on trait default values being checked through validator, which was added in traitlets 4.3.2.
Fixes Issue jupyterhub#997. Also updated Traitlets to 4.3.2 since the change in singleuser.py relies on trait default values being checked through validator, which was added in traitlets 4.3.2.
How to reproduce the issue
Add the shared notebook as a service managed configuration example to your jupyter configuration with the service name as
formgrader-class101
. Visit https://hub-url/services/formgrader-class101 and you'll see thatcustom.css
andcustom.js
give 404s.What you expected to happen
To not get 404s.
What actually happens
You get 404s
Share what version of JupyterHub you are using
master
Running
jupyter troubleshoot
from the command line, if possible, and postingits output would also be helpful.
Workaround
The issue is that the urls for
custom.js
andcustom.css
arehttps://hub-url/services/formgrader-class101custom/custom.css
and are missing a forward slash. The following change fixes this:The text was updated successfully, but these errors were encountered: