Notebook commands hang after restarting a cluster with custom library installed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I'm experiencing an issue with a Databricks notebook after restarting a cluster that has a custom library installed.
Here are the steps I followed:
- Created a Databricks compute cluster.
- Attached a notebook to the cluster.
- Installed a library required to connect to Hive.
- Restarted the cluster.
- Ran the Hive connection code in the notebook, and it executed successfully.
After a few hours, the cluster auto-terminated.
The next day, I restarted the same cluster and opened the same notebook (still attached to that cluster). However, when I tried to run even simple commands, such as a basic SQL query or print statement, the commands would remain in a running state indefinitely and never complete.
The only workaround I've found is to create a new cluster, install the library again, and repeat the setup process. Everything works correctly until the cluster terminates again.
This behavior seems to occur whenever I install a library on a cluster. The notebook works fine initially, but after the cluster is terminated and restarted, commands hang and do not execute.
Is this expected behavior? Has anyone encountered a similar issue or knows what might be causing it?
Thanks in advance for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Cluster-scoped libraries aren't a one-time install — they get reinstalled automatically every time the cluster restarts. If that reinstall stalls (network path to the library source, private repo/artifactory unreachable, dependency conflict with the Hive connector), the driver's REPL never finishes initializing, so even print() or a trivial SQL cell just sits in "Running" forever, waiting behind the pending library install.
Move the Hive connector library to a cluster-scoped init script instead of the UI "Install Library" button. Init scripts run before the Python REPL comes up and are far more reliable/deterministic than the async library-install mechanism, especially for connector libraries with native/JAR dependencies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Thank you for the response. From the driver logs I gather that the REPL has crashed, but this isn't the case only with Hive. I have noticed this pattern with Oracle library installation as well.