cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Can not open socket to local (127.0.0.1)

HansAdriaans
New Contributor II

Hi, I'm running a databricks pipeline hourly using python notebooks checked out from git with on-demand compute (using r6gd.xlarge 32GB + 4 CPU's Gravaton). Most of the times the pipeline runs without problems. However, sometimes the first notebook fails with the error after starting the cluster

```Can not open socket: ["tried to connect to ('127.0.0.1', 36349), but an error occurred: [Errno 111] Connection refused"].```

This happens with the first interaction between the notebook and spark, running the command 

```
km_per_nm = (
spark.read.table(assumptions_table)
.where(f.col("item") == "km_per_nm")
.collect()[0]
.asDict()
.get("value")
)
```
 
I know that this could be a sign of an OOM issue, but the result of that query is a single value from 1 row. The entire table is just 1.5 kb anyway and the driver has 32GiB of mem. 
 
Can you guys help me with ideas where to look at ?
1 REPLY 1

HansAdriaans
New Contributor II

Short update, I changed the script a bit by simply adding a display function just before the running the collect and this seems to work for now

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group