Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

c.DockerSpawner.notebook_dir not working with JupyterHub 0.8

See original GitHub issue


I am following this repo to setup my JupyterHub instance on a single server.

Recently, the repo was upgraded to JupyterHub 0.8 and I followed the changes. However, since the upgrade, the parameter c.DockerSpawner.notebook_dir doesn’t seem to have an effect and the single user servers are always started at /home/jovyan instead of /home/jovyan/work

I tried giving different values to the configuration param but it always starts at home directory.

I rollbacked my system to old code before the changes made in last few days and it worked again.

Any help is appreciated.

Thanks, Bhopesh

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

minrkcommented, Oct 26, 2017

Why would setting it explicitly create a problem?

It’s not why, it’s how. By default, DockerSpawner builds the command to launch the docker image from config such as c.DockerSpawner.cmd, c.DockerSpawner.ip, etc. There are also some options that allow you to bypass any logic in DockerSpawner, and talk directly to Docker. extra_create_kwargs is one such option. By specifying extra_create_kwargs.command, you are saying that you have decided what the command to launch should be, and that DockerSpawner should not try to build the command itself.

bbhopeshcommented, Oct 22, 2017

I figured a fix by trial and error but I don’t know why my fix is working. There’s some problem with the script.

Removing following two lines from starts the single user notebook servers at /home/jovyan/work, otherwise single user notebook servers always start at /home/jovyan irrespective of value of c.DockerSpawner.notebook_dir.

Lines to be removed from

spawn_cmd = os.environ.get('DOCKER_SPAWN_CMD', "")
c.DockerSpawner.extra_create_kwargs.update({ 'command': spawn_cmd })
Read more comments on GitHub >

github_iconTop Results From Across the Web

Changes in DockerSpawner
DockerSpawner.hub_ip_connect is deprecated when running with JupyterHub 0.8. Use JupyterHub.hub_connect_ip instead, which is used by all Spawners.
Read more >
SwarmSpawner fails on spawn notebook servers
I am using a `JupyterHub` deployment with `SwarmSpawner`. When I try to login, `JupyterHub` fails spawning the new container. I have the debug...
Read more >
How To: Change the default start directory for Jupyter Notebook
Temporarily start Jupyter Notebook in a different directory using the ... NotebookApp.notebook dir = r'C:\Users\User\Desktop\Work\test'.
Read more >
After updating JupyterHub 0.8.1 to 1.3.0.Not able to spawn ...
Docker images created should spawn without issues with network type as “host” with jupyterhub version :1.3.0.
Read more >
Deploying a containerized JupyterHub server with Docker
These are nothing else than the Jupyter notebook servers you are used to run on your personal computer, however they are started and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found