jupyterhub / dockerspawner

Spawns JupyterHub single user servers in Docker containers
https://jupyterhub-dockerspawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
491 stars 308 forks source link

DockerSpawner emits: [[**Spawn failed: The 'ip' trait of a Server instance expected a unicode string, not the NoneType None.]] on a docker image that is cloned with zero changes (via docker(1) commit ...) #425

Closed nmvega closed 1 year ago

nmvega commented 3 years ago

Hello Friends:

I have several custom docker images that successfully launch under JupyterHub's DockerSpawner.

However, when I launch any of those images like this:

root# docker run -it --rm --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
      acme/acme-notebook:1.0 /bin/bash

and then literally make zero changes inside it (meaning I issue absolutely no commands while in that session), and then finally in another terminal commit it:

root# docker commit <above-container-id> acme/acme-notebook:1.1

When that committed image is selected via the JupyterHub dropdown menu, the following error occurs:

Error: HTTP 500: Internal Server Error (Error in Authenticator.pre_spawn_start:
TraitError The 'ip' trait of a Server instance expected a unicode string, not
the NoneType None.)

Yet no changes were made, commands wise.

I get the same failure when trivially committing the Jupyter Stacks image:

Because certain build-actions cannot be performed at docker(1) build [...] time, it is necessary to modify and commit images after the build, but I'm having this issue when I do (even when that change is a null change).

This exception keeps reoccurring on trivial things; for example here too (where inclusion of a tiny spawn hook script causes the same exception).

My JupyterHub is something I also built from scratch as a Docker, container and runs well. Here's is it's configuration as of last year; but I can post it again (it's changed a little bit). Perhaps there's a trait / setting that will reveal something.

This looks like a bug, and I don't know where to even start to debug it.

Thank you.

minrk commented 3 years ago

Authenticator.pre_spawn_start is not defined by default. Do you have a custom Authenticator? I see from your config that you are using oauthenticator.gitlab.GitLabOAuthenticator, but this class does not have a non-empty pre_spawn_start method. Are you perhaps using a custom version of oauthenticator?

Can you include the output of pip list (or conda list) and the logs from jupyterhub start up to the error? You might also launch jupyterhub with --debug