You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using {imagename} in name_template produces a Bad Request "Invalid container name" error when starting the server.
Expected behaviour
The container should spawn without error.
In addition, the container name should be based on the image, e.g., datascience-notebook for jupyter/datascience-notebook.
Actual behaviour
When launching the Jupyter notebook container, Jupyterhub sends this error: Bad Request ("Invalid container name (jupyterhub-singleuser:3.1-vncntprvst–), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed")
How to reproduce
Define c.DockerSpawner.name_template = '{imagename}-{username}–{servername}' in jupyterhub_config.py and
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋
A couple things I tried to solve this but didn't work.
Adding this bit of code to the pre_spawn_hook:
# Remove repository and image tag from image name
image_name = spawner.image.split(':')[0].split('/')[-1]
# Sanitize image name
sanitized_image_name = re.sub(r'[^a-zA-Z0-9_.-]', '', image_name)
# Set name_template with sanitized imagename, username, and servername
spawner.name_template = f"{sanitized_image_name}-{spawner.user.name}--{spawner.name}"
This had no impact.
Also, defining name_template as follow: c.DockerSpawner.name_template = '{imagename.split(":")[0]}-{username}--{servername}'
produced an Error 500.
minrk
changed the title
Incorrect imagename and tag not sanitized
Incorrect imagename and tag not sanitized in name_template
May 31, 2023
minrk
changed the title
Incorrect imagename and tag not sanitized in name_template
imagename and tag not sanitized in name_template
May 31, 2023
Bug description
Using
{imagename}
inname_template
produces aBad Request "Invalid container name"
error when starting the server.Expected behaviour
The container should spawn without error.
In addition, the container name should be based on the image, e.g.,
datascience-notebook
forjupyter/datascience-notebook
.Actual behaviour
When launching the Jupyter notebook container, Jupyterhub sends this error:
Bad Request ("Invalid container name (jupyterhub-singleuser:3.1-vncntprvst–), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed")
How to reproduce
Define
c.DockerSpawner.name_template = '{imagename}-{username}–{servername}'
injupyterhub_config.py
andthen select 'Data science' from the drop-down menu
Your personal set up
The server code repository is found here: https://github.com/wanglab-neuro/jupyterlab_server
jupyterhub/jupyterhub:3.1.1
withdockerspawner 12.1.0
The text was updated successfully, but these errors were encountered: