question-mark
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.

DockerSpawner template_namespace

See original GitHub issue
[I 2019-03-03 06:25:03.970 JupyterHub app:1673] Using Authenticator: oauthenticator.gitlab.GitLabOAuthenticator-0.8.1
[I 2019-03-03 06:25:03.971 JupyterHub app:1673] Using Spawner: dockerspawner.dockerspawner.DockerSpawner-0.11.0
[E 2019-03-03 06:25:30.635 JupyterHub pages:148] Failed to spawn single-user server with form
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/handlers/pages.py", line 146, in post
        await self.spawn_single_user(user, options=options)
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/handlers/base.py", line 705, in spawn_single_user
        timedelta(seconds=self.slow_spawn_timeout), finish_spawn_future
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/handlers/base.py", line 626, in finish_user_spawn
        await spawn_future
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/user.py", line 489, in spawn
        raise e
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/user.py", line 409, in spawn
        url = await gen.with_timeout(timedelta(seconds=spawner.start_timeout), f)
      File "/opt/conda/lib/python3.6/site-packages/dockerspawner/dockerspawner.py", line 984, in start
        obj = yield self.create_object()
      File "/opt/conda/lib/python3.6/site-packages/dockerspawner/dockerspawner.py", line 852, in create_object
        command=(yield self.get_command()),
      File "/opt/conda/lib/python3.6/site-packages/dockerspawner/dockerspawner.py", line 812, in get_command
        return cmd + self.get_args()
      File "/opt/conda/lib/python3.6/site-packages/dockerspawner/dockerspawner.py", line 726, in get_args
        args = super().get_args()
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/spawner.py", line 700, in get_args
        notebook_dir = self.format_string(self.notebook_dir)
      File "/opt/conda/lib/python3.6/site-packages/jupyterhub/spawner.py", line 681, in format_string
        return s.format(**self.template_namespace())
    TypeError: 'dict' object is not callable

the template_namespace is overwritten as a property

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
playermanny2commented, Mar 8, 2019

Same issue here! RUN pip install dockerspawner==0.10.0 inside my Dockerfile as a temporary solutino

2reactions
mannichecommented, Apr 5, 2019

in https://github.com/jupyterhub/jupyterhub/blob/0.9.6/jupyterhub/spawner.py#L699 and forward, the code checks if the configuration values for notebook_dir or default_url are set. If either is the case, it will call s.format as a method, when it at runtime is a dict type. Having either c.Spawner.default_url or c.DockerSpawner.notebook_dir in your jupyterhub_config.py will trigger this error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DockerSpawner API - Read the Docs
Return the template namespace for format-string formatting. Currently used on default_url and notebook_dir. Subclasses may add items to the available ...
Read more >
Release 12.1.0 Jupyter Contributors - DockerSpawner
template_namespace(). Return the template namespace for format-string formatting. Currently used on default_url and notebook_dir. Subclasses may ...
Read more >
Release 12.1.0.dev0 Jupyter Contributors - DockerSpawner
template_namespace(). Return the template namespace for format-string formatting. Currently used on default_url and notebook_dir. Subclasses may ...
Read more >
DockerSpawner
The dockerspawner (also known as JupyterHub Docker Spawner), enables JupyterHub to spawn single user notebook servers in Docker containers.
Read more >
jupyterhub/dockerspawner - GitHub
The dockerspawner (also known as JupyterHub Docker Spawner), enables JupyterHub to spawn single user notebook servers in Docker containers.
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found