# Jupyterhub in Docker with SystemUserSpawner'

**URL:** <https://discourse.jupyter.org/t/jupyterhub-in-docker-with-systemuserspawner/13741>\
**Category:** JupyterHub\
**Created:** [April 5, 2022, 1:52pm UTC](https://discourse.jupyter.org/t/jupyterhub-in-docker-with-systemuserspawner/13741 "2022-04-05T13:52:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cablesky](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/cablesky/32/6871_2.png) [@cablesky](https://discourse.jupyter.org/u/cablesky)\
**Post date:** [April 5, 2022, 1:52pm UTC](https://discourse.jupyter.org/t/jupyterhub-in-docker-with-systemuserspawner/13741/1 "2022-04-05T13:52:06Z")

</div>

Hello!  
I want to run Jupyterhub with the SystemUserSpawner in the Docker container.  
I used the following example for this ([https://github.com/jupyterhub/dockerspawner/tree/main/examples/simple](https://github.com/jupyterhub/dockerspawner/tree/main/examples/simple))  
and only added the following lines to jupyterhub\_config.py:

> from dockerspawner import SystemUserSpawner  
> c.JupyterHub.spawner\_class = SystemUserSpawner

After starting the JupyterHub container, I created a user “abc” inside the JupyterHub container:

> useradd -m abc

After that I logged into the JupyterHub with “abc” and wanted to start a notebook. Here came the following error message:

> jupyterhub\_1 | [I 2022-04-05 13:41:39.955 JupyterHub log:189] 200 GET /hub/login?next=%2Fhub%2F (@::ffff:192.168.64.1) 23.44ms  
> jupyterhub\_1 | [I 2022-04-05 13:42:06.607 JupyterHub base:813] User logged in: abc  
> jupyterhub\_1 | [I 2022-04-05 13:42:06.607 JupyterHub log:189] 302 POST /hub/login?next=%2Fhub%2F → /hub/ (abc@::ffff:192.168.64.1) 9.64ms  
> jupyterhub\_1 | [I 2022-04-05 13:42:06.812 JupyterHub log:189] 302 GET /hub/ → /hub/spawn (abc@::ffff:192.168.64.1) 23.94ms  
> jupyterhub\_1 | [I 2022-04-05 13:42:06.919 JupyterHub roles:482] Adding role server to token: \<APIToken(‘e63f…’, user=‘abc’, client\_id=‘jupyterhub’)\>  
> jupyterhub\_1 | [I 2022-04-05 13:42:06.948 JupyterHub provider:607] Creating oauth client jupyterhub-user-abc  
> jupyterhub\_1 | [I 2022-04-05 13:42:07.032 JupyterHub dockerspawner:988] Container ‘jupyter-abc’ is gone  
> jupyterhub\_1 | [I 2022-04-05 13:42:07.207 JupyterHub dockerspawner:1272] Created container jupyter-abc (id: 184e382) from image jupyter/base-notebook:hub-2.2.2  
> jupyterhub\_1 | [I 2022-04-05 13:42:07.207 JupyterHub dockerspawner:1296] Starting container jupyter-abc (id: 184e382)  
> jupyterhub\_1 | [I 2022-04-05 13:42:07.915 JupyterHub log:189] 302 GET /hub/spawn → /hub/spawn-pending/abc (abc@::ffff:192.168.64.1) 1003.95ms  
> jupyterhub\_1 | [I 2022-04-05 13:42:08.020 JupyterHub pages:401] abc is pending spawn  
> jupyterhub\_1 | [I 2022-04-05 13:42:08.024 JupyterHub log:189] 200 GET /hub/spawn-pending/abc (abc@::ffff:192.168.64.1) 6.61ms  
> jupyterhub\_1 | [I 2022-04-05 13:42:16.917 JupyterHub dockerspawner:988] Container ‘jupyter-abc’ is gone  
> jupyterhub\_1 | [W 2022-04-05 13:42:16.917 JupyterHub dockerspawner:963] Container not found: jupyter-abc  
> jupyterhub\_1 | ERROR:asyncio:Task exception was never retrieved  
> jupyterhub\_1 | future: \<Task finished name=‘Task-47’ coro=\<BaseHandler.spawn\_single\_user() done, defined at /usr/local/lib/python3.8/dist-packages/jupyterhub/handlers/base.py:847\> exception=HTTPError()\>  
> jupyterhub\_1 | Traceback (most recent call last):  
> jupyterhub\_1 | File “/usr/local/lib/python3.8/dist-packages/jupyterhub/handlers/base.py”, line 1048, in spawn\_single\_user  
> jupyterhub\_1 | await gen.with\_timeout(  
> jupyterhub\_1 | tornado.util.TimeoutError: Timeout  
> jupyterhub\_1 |  
> jupyterhub\_1 | During handling of the above exception, another exception occurred:  
> jupyterhub\_1 |  
> jupyterhub\_1 | Traceback (most recent call last):  
> jupyterhub\_1 | File “/usr/local/lib/python3.8/dist-packages/jupyterhub/handlers/base.py”, line 1082, in spawn\_single\_user  
> jupyterhub\_1 | raise web.HTTPError(  
> jupyterhub\_1 | tornado.web.HTTPError: HTTP 500: Internal Server Error (Spawner failed to start [status=0]. The logs for abc may contain details.)  
> jupyterhub\_1 | [I 2022-04-05 13:42:37.666 JupyterHub dockerspawner:988] Container ‘jupyter-abc’ is gone  
> jupyterhub\_1 | [W 2022-04-05 13:42:37.667 JupyterHub dockerspawner:963] Container not found: jupyter-abc  
> jupyterhub\_1 | [W 2022-04-05 13:42:50.277 JupyterHub user:864] abc’s server never showed up at [http://192.168.64.3:8888/user/abc/](http://192.168.64.3:8888/user/abc/) after 30 seconds. Giving up.  
> jupyterhub\_1 |  
> jupyterhub\_1 | Common causes of this timeout, and debugging tips:

Can anyone tell me what I am doing wrong?
