Resolving JupyterLab connection issues after Workbench upgrade
After upgrading Posit Workbench, JupyterLab sessions disconnect after 1-2 minutes with the error message “Disconnected from Workbench - The underlying JupyterLab connection has been closed.”
Description
Issue
After upgrading Workbench, JupyterLab sessions disconnect after 1-2 minutes with the error message “Disconnected from Workbench - The underlying JupyterLab connection has been closed.”
Explanation
Newer versions of Workbench come bundled with Jupyter and VS Code. However, when upgrading Workbench from an older version, Jupyter sessions may experience heartbeat issues due to conflicts between the Workbench-bundled Jupyter extensions and previously installed extensions. This is due to Jupyter recognizing multiple versions of the workbench_jupyterlab extension.
Solution
Identify the Jupyter version
Check the Jupyter configuration file to determine the version of Jupyter running on your system:
Terminal
cat /etc/rstudio/jupyter.confLog in as a session user
Ensure you are logged in as an appropriate session user before making any changes.
Determine Jupyter paths
Run the following command to see all paths used by Jupyter:
Terminal
jupyter --pathsLocate the
workbench_jupyterlabfolderLook for the
workbench_jupyterlabextension folder within the Jupyter lab extensions directory, typically found in:Terminal
/usr/local/share/jupyter/labextensionsUninstall the extension
Attempt to remove the extension using the Jupyter labextension uninstall command:
Terminal
jupyter labextension uninstall workbench_jupyterlabIf this command does not work, check the user’s local directory and manually remove the folder:
Terminal
rm -fr ~/.local/share/jupyter/labextensions/workbench_jupyterlabEnsure you have the latest
pwb_jupyterlabpackage installed:Terminal
sudo /opt/python/[version]/bin/pip install --upgrade pwb_jupyterlabRemove deprecated packages that may cause conflicts:
rsp-jupyterworkbench_jupyterlab
Restart the Workbench services after making these changes.
Additional Resources
If you’re still having issues, you can reach out to Support by opening a ticket.