> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Preventing Jupyter timeout errors when running notebooks as a batch/scheduled job

If you are running a Jupyter notebook as a batch job, and it contains a long-running cell, you may encounter the following error:

```
[NbConvertApp] ERROR | Timeout waiting for execute reply (30s). If your cell should take longer than this, you can increase the timeout with: c.ExecutePreprocessor.timeout = SECONDS in jupyter_nbconvert_config.py
```

This indicates that the cell caused Jupyter to timeout. You can avoid this by configuring a longer timeout. Here's how to do it in the pre-setup script of a [custom environment](https://docs.dominodatalab.com/en/latest/reference/environments/Environment_management.html) definition:

```
echo "c.ExecutePreprocessor.timeout = $SECONDS" >> /home/ubuntu/.ipython/profile_default/ipython_nbconvert_config.py
chown ubuntu:ubuntu /home/ubuntu/.ipython/profile_default/ipython_nbconvert_config.py
```

Substitute an appropriate value for **\$SECONDS**. Note the *chown* command - this is needed because the pre-setup script runs as the root user, so the file ownership must be changed back to the ubuntu user in order to avoid a permissions error during your run. Keep in mind this is for batch runs.

**Note:** later versions of Jupyter require you to modify a different config file *(`/home/ubuntu/.jupyter/jupyter_nbconvert_config.py`* instead of `/home/ubuntu/.ipython/profile_default/ipython_nbconvert_config.py`).

If you are running a recent Jupyter version and the above commands do not work, use this instead:

```
echo "c.ExecutePreprocessor.timeout = $SECONDS" >> /home/ubuntu/.jupyter/jupyter_nbconvert_config.py
chown ubuntu:ubuntu /home/ubuntu/.jupyter/jupyter_nbconvert_config.py
```


## Related topics

- [How-to guides](/knowledge-base/how-to-guides-overview.md)
- [Increasing the timeout for Shiny Server](/knowledge-base/increasing-the-timeout-for-shiny-server.md)
- [Architecture overview](/cloud/admin/architecture-and-deployment/architecture/index.md)
- [The python-domino library](/cloud/reference/python-sdk/python-domino.md)
