# Timed out waiting for Jupyter Notebook

**URL:** <https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244>\
**Category:** Get Help\
**Tags:** question\
**Created:** [February 1, 2024, 2:31pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244 "2024-02-01T14:31:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gp4r](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/gp4r/32/62_2.png) [@gp4r](https://discourse.openondemand.org/u/gp4r)\
**Post date:** [February 1, 2024, 2:31pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244/1 "2024-02-01T14:31:16Z")

</div>

Hello,

Frequently, our users are having a time out issue when they launch JupyterLab.

```auto
TTT - Thu Feb 1 08:37:21 EST 2024
TIMING - Starting jupyter at: Thu Feb 1 08:37:21 EST 2024
+ export XDG_RUNTIME_DIR=
+ XDG_RUNTIME_DIR=
+ jupyter lab --config=/home/rz3jr/ondemand/data/sys/dashboard/batch_connect/sys/jupyter_lab/output/f0ff26ee-9aff-4d18-9f84-06f957e4c6f5/config.py --notebook-dir=/home/rz3jr
Timed out waiting for Jupyter Notebook server to open port 54645!
TIMING - Wait ended at: Thu Feb 1 08:38:09 EST 2024
Cleaning up...

```

When I checked the TIMING.  
TIMING - Starting jupyter at: Thu Feb 1 08:37:21 EST 2024  
TIMING - Wait ended at: Thu Feb 1 08:38:09 EST 2024

What is the default time out for the session? Is it possible to increase the time out value?

Thank you

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [February 1, 2024, 3:09pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244/2 "2024-02-01T15:09:24Z")

</div>

Looking at the Juypter docs, which are not as clear as I hoped, they seem to timeout after 30s or not at all. So, I’m not sure.

The docs are saying that `MappingKernelManager.cull_idle_timeout : Int` is what sets this but they also claim it’s set to `0` by default and therefore disabled, but that doesn’t sound like what you are experiencing.

Try adding that line yourself in the `before.sh` like this:

```auto
# Generate Jupyter configuration file with secure file permissions
(
umask 077
cat > "${CONFIG_FILE}" << EOL
c.KernelSpecManager.ensure_native_kernel = False
...
# Try hard setting the timeout to 0 and prevent culling
# if that still doesn't work increase the number
MappingKernelManager.cull_idle_timeout : 0
...
EOL
)

```

If setting it to `0` first doesn’t stop the problem, which is supposed to be the default and disable culling, see what happens when you increase to `60` and if it is longer than `30` seconds.

If that doesn’t work the other setting I’d try and add to the `before.sh` like above would be the `MappingKernelManager.kernel_info_timeout : Float` which defaults to `60` seconds and is the timeout for giving up on a kernel (in seconds).

---

<div class="post-metadata">

**Author:** ![gp4r](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/gp4r/32/62_2.png) [@gp4r](https://discourse.openondemand.org/u/gp4r)\
**Post date:** [February 1, 2024, 5:31pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244/3 "2024-02-01T17:31:02Z")

</div>

Thank you Travis,

I applied the setting but I didn’t see any change. I will do more tests.

I have another question regarding [Requirements — Open OnDemand 3.0.3 documentation](https://osc.github.io/ood-documentation/latest/requirements.html)  
It says “The Passenger apps that make up the core of OnDemand (that NGINX is configured with), are each killed after a short period (5 minutes) of inactivity from the user,” Does it mean OSC runs “nginx\_stage nginx\_clean” every 5min? I see it every 2 hours in our cron setting.

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [February 1, 2024, 5:38pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244/4 "2024-02-01T17:38:49Z")

</div>

No, I think those docs are just old maybe and out of date. I’ve never had a timeout from walking away for 5 mins of my entire PUN. I’ve created a doc ticket to look into what’s there and fix it:

> <https://github.com/OSC/ood-documentation/issues/928>
>
> A discourse came in asking about the 5 minute PUN cleanup they read about in the… requirements section:
> https://osc.github.io/ood-documentation/latest/requirements.html#hardware-requirements
> 
> There's a line that says:
> "The Passenger apps that make up the core of OnDemand (that NGINX is configured with), are each killed after a short period (5 minutes) of inactivity from the user"
> 
> I'm pretty sure that is not correct, and if it is I've never had my PUN cleaned up after 5 minutes of inactivity so I'd wonder what our setup is. Either way, this needs to be addressed and corrected or ensure it's correct.

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [February 1, 2024, 5:42pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244/5 "2024-02-01T17:42:21Z")

</div>

I wonder if you adjust the `ProxyTimeout` in the `script.sh` if that would catch the issue. Maybe apache is what is timing out and not Jupyter would be my thinking here.

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 1, 2024, 5:52pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244/6 "2024-02-01T17:52:01Z")

</div>

The timeout you’re looking at is coming from your `after.sh`. You can see here our production jupyter will wait for 5 minutes.

> <https://github.com/OSC/bc_osc_jupyter/blob/master/template/after.sh.erb>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [July 30, 2024, 5:52pm UTC](https://discourse.openondemand.org/t/timed-out-waiting-for-jupyter-notebook/3244/7 "2024-07-30T17:52:41Z")

</div>

Closed on July 30, 2024, 5:52pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
