Skip to main content
If you are running a Jupyter notebook as a batch job, and it contains a long-running cell, you may encounter the following error:
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 definition:
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:
Last modified on October 12, 2026