# Jupyterhub fails to spawn, singleuser logs indicate a read permission error

**URL:** <https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158>\
**Category:** JupyterHub\
**Created:** [September 6, 2024, 6:15am UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158 "2024-09-06T06:15:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanzgiri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/sanzgiri/32/14753_2.png) [@sanzgiri](https://discourse.jupyter.org/u/sanzgiri)\
**Post date:** [September 6, 2024, 6:15am UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158/1 "2024-09-06T06:15:14Z")

</div>

Jupyterhub fails to spawn with the following errors:

Sep 06 06:02:38 python3[553254]: [I 2024-09-06 06:02:38.149 JupyterHub pages:399] app\_jupyterhub is pending spawn  
Sep 06 06:02:38 python3[553254]: [W 2024-09-06 06:02:38.329 JupyterHub \_xsrf\_utils:195] Skipping XSRF check for insecure request GET /hub/api/users/app\_jupyterhub/server/progress  
Sep 06 06:02:47 python3[553254]: [W 2024-09-06 06:02:47.025 JupyterHub base:1190] User app\_jupyterhub is slow to start (timeout=10)  
Sep 06 06:02:55 python3[553254]: [I 2024-09-06 06:02:55.099 JupyterHub log:192] 200 GET /hub/api/ ([cull-idle@127.0.0.1](mailto:cull-idle@127.0.0.1)) 17.02ms  
Sep 06 06:02:55 python3[553254]: [I 2024-09-06 06:02:55.108 JupyterHub log:192] 200 GET /hub/api/users?state=[secret] ([cull-idle@127.0.0.1](mailto:cull-idle@127.0.0.1)) 6.15ms  
Sep 06 06:03:37 python3[553254]: [W 2024-09-06 06:03:37.147 JupyterHub user:879] app\_jupyterhub’s server failed to start in 60 seconds, giving up.  
Sep 06 06:03:37 python3[553254]:  
Sep 06 06:03:37 python3[553254]: Common causes of this timeout, and debugging tips:  
Sep 06 06:03:37 python3[553254]:  
Sep 06 06:03:37 python3[553254]: 1. Everything is working, but it took too long.  
Sep 06 06:03:37 python3[553254]: To fix: increase `Spawner.start_timeout` configuration  
Sep 06 06:03:37 python3[553254]: to a number of seconds that is enough for spawners to finish starting.  
Sep 06 06:03:37 python3[553254]: 2. The server didn’t finish starting,  
Sep 06 06:03:37 python3[553254]: or it crashed due to a configuration issue.  
Sep 06 06:03:37 python3[553254]: Check the single-user server’s logs for hints at what needs fixing.  
Sep 06 06:03:37 python3[553254]:  
Sep 06 06:03:37 python3[553254]: [E 2024-09-06 06:03:37.188 JupyterHub gen:629] Exception in Future \<Task finished name=‘Task-1269’ coro=\<BaseHandler.spawn\_single\_user..finish\_user\_spawn() done, defined at /opt/tljh/hub/lib/python3.8/site-packages/jupyterhub/handlers/base.py:1081\> exception=TimeoutError(‘Timeout’)\> after timeout  
Sep 06 06:03:37 python3[553254]: Traceback (most recent call last):  
Sep 06 06:03:37 python3[553254]: File “/opt/tljh/hub/lib/python3.8/site-packages/tornado/gen.py”, line 624, in error\_callback  
Sep 06 06:03:37 python3[553254]: future.result()  
Sep 06 06:03:37 python3[553254]: File “/opt/tljh/hub/lib/python3.8/site-packages/jupyterhub/handlers/base.py”, line 1088, in finish\_user\_spawn  
Sep 06 06:03:37 python3[553254]: await spawn\_future  
Sep 06 06:03:37 python3[553254]: File “/opt/tljh/hub/lib/python3.8/site-packages/jupyterhub/user.py”, line 905, in spawn  
Sep 06 06:03:37 python3[553254]: raise e  
Sep 06 06:03:37 python3[553254]: File “/opt/tljh/hub/lib/python3.8/site-packages/jupyterhub/user.py”, line 801, in spawn  
Sep 06 06:03:37 python3[553254]: url = await gen.with\_timeout(timedelta(seconds=spawner.start\_timeout), f)  
Sep 06 06:03:37 python3[553254]: asyncio.exceptions.TimeoutError: Timeout  
Sep 06 06:03:37 python3[553254]:

If I look at the singleuser logs, I see the following:

Sep 06 05:13:28 systemd[1]: jupyter-app\_jupyterhub.service: Failed to load environment files: No such file or directory  
Sep 06 05:13:28 systemd[1]: jupyter-app\_jupyterhub.service: Failed to run ‘start’ task: No such file or directory  
Sep 06 05:13:28 systemd[1]: jupyter-app\_jupyterhub.service: Failed with result ‘resources’.  
Sep 06 05:13:28 systemd[1]: Failed to start /opt/tljh/user/bin/jupyterhub-singleuser.  
Sep 06 05:13:52 systemd[1]: jupyter-app\_jupyterhub.service: Failed to open /run/systemd/transient/jupyter-app\_jupyterhub.service: No such \>  
Sep 06 05:13:52 systemd[1]: Started /opt/tljh/user/bin/jupyterhub-singleuser.  
Sep 06 05:13:52 systemd[545647]: jupyter-app\_jupyterhub.service: Changing to the requested working directory failed: Permission denied  
Sep 06 05:13:52 systemd[545647]: jupyter-app\_jupyterhub.service: Failed at step CHDIR spawning /opt/tljh/user/bin/jupyterhub-singleuser: P\>  
Sep 06 05:13:52 systemd[1]: jupyter-app\_jupyterhub.service: Main process exited, code=exited, status=200/CHDIR  
Sep 06 05:13:52 systemd[1]: jupyter-app\_jupyterhub.service: Failed with result ‘exit-code’.

> Blockquote

Not sure what files it is unable to find. I have removed /opt/tljh and reinstalled.

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [September 6, 2024, 5:22pm UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158/2 "2024-09-06T17:22:27Z")

</div>

Can you give us enough information to reproduce the problem? For example, what operating system are you using, is it a standard OS or have you customised it, how did you install and configure TLJH?

---

<div class="post-metadata">

**Author:** ![sanzgiri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/sanzgiri/32/14753_2.png) [@sanzgiri](https://discourse.jupyter.org/u/sanzgiri)\
**Post date:** [September 9, 2024, 12:18am UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158/3 "2024-09-09T00:18:15Z")

</div>

I am running Jupyterhub on my own Ubuntu server. I am following the steps described here: [Installing on your own server — The Littlest JupyterHub documentation](https://tljh.jupyter.org/en/latest/install/custom-server.html)

The only custom change beyond what is described in the link above is to install some additional python modules. Was getting an error about missing jupyter-core earlier, so ran this: (this was from a github issue where someone else was running into a similar problem)  
sudo /opt/tljh/user/bin/python3 -m pip install notebook

I get the same error on both Ubuntu 20.04 and 22.04.

Thanks,  
Ashutosh

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [September 9, 2024, 9:50am UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158/4 "2024-09-09T09:50:03Z")

</div>

Do you get the same error if you install TLJH on a clean system, without your custom changes?

---

<div class="post-metadata">

**Author:** ![sanzgiri](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/sanzgiri/32/14753_2.png) [@sanzgiri](https://discourse.jupyter.org/u/sanzgiri)\
**Post date:** [September 17, 2024, 12:56am UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158/5 "2024-09-17T00:56:22Z")

</div>

Hi @manics - apologies for the delay in responding. On a clean system where I am only running the following commands:

sudo apt install python3 python3-dev git curl  
curl -L [The Littlest Jupyterhub](https://tljh.jupyter.org/bootstrap.py) | sudo -E python3 - --admin app\_jupyterhub

I see the following error in the single user journalctl logs:  
ModuleNotFoundError: No module named ‘jupyter\_core’

Per the github issue [ModuleNotFoundError: No module named 'jupyter\_core' · Issue #965 · jupyterhub/the-littlest-jupyterhub · GitHub](https://github.com/jupyterhub/the-littlest-jupyterhub/issues/965) the fix for this is to run  
sudo /opt/tljh/user/bin/python3 -m pip install notebook

This is the only custom command I run. After doing this, I am now able to get Jupyterhub to run successfully on one machine. But this not the one that I actually want to run it on  
On the intended machine, I get the CHDIR permissions error in my original post.

I have cleaned my install by recursively removing /opt/tljh and rebooting. Are there any other directories that need to be removed for a clean reinstall of tljh?

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [September 23, 2024, 1:43pm UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158/6 "2024-09-23T13:43:37Z")

</div>

You might have some user home directories left behind.

---

<div class="post-metadata">

**Author:** ![Virginie\_trinite](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/virginie_trinite/32/18298_2.png) [@Virginie\_trinite](https://discourse.jupyter.org/u/Virginie_trinite)\
**Post date:** [April 11, 2025, 12:39pm UTC](https://discourse.jupyter.org/t/jupyterhub-fails-to-spawn-singleuser-logs-indicate-a-read-permission-error/28158/7 "2025-04-11T12:39:25Z")

</div>

Hi  
I have the same problem and I manage to resolved it:  
The problem is that the username are transfrom in jupyter-username in TLJH.  
If you want to bypass this you have to remove the “jupyter-” string in 3 files in /opt/tljh/hub/lib/python3.10/site-packages/tljh:  
diff user\_creating\_spawner.py  
/\< system\_username = generate\_system\_username(“jupyter-” + self.user.name)  
/—  
/\> system\_username = generate\_system\_username(self.user.name)

diff jupyterhub\_config.py  
/\< c.SystemdSpawner.unit\_name\_template = “{USERNAME}”  
/—  
/\> c.SystemdSpawner.unit\_name\_template = “jupyter-{USERNAME}”

diff configurer.py  
/\<c.SystemdSpawner.username\_template = “{USERNAME}”  
/—  
/\>c.SystemdSpawner.username\_template = “jupyter-{USERNAME}”

Found this solution and adapt from  
[https://www.reddit.com/r/JupyterNotebooks/comments/pfah2c/can\_i\_setup\_jupyterhub\_tljh\_to\_use\_preexisting/](https://www.reddit.com/r/JupyterNotebooks/comments/pfah2c/can_i_setup_jupyterhub_tljh_to_use_preexisting/)
