3 weeks ago
I am running PySpark application in AKS/Pythgon container/pod:
Using Databricks 18.2.1 library with Databricks Spark cluster 18.2
Once a while I am getting below error:
InactiveRpcError of RPC that terminated with: status = StatusCode.UNIMPLEMENTED details = "Received http2 header with status: 404" debug_error_string = "UNIMPLEMENTED:Received http2 header with status: 404
I don't see any cluster health or events that are concerning other than there are few scale up/down events. Not sure if these events OR any intermittent network issues causing any open Spark sessions to lose connectivity.
But I thought DatabricksConnect 18.2.1 fixed handling these reconnect issues better.
I am not exactly sure of what is triggering but I am positive its Library not able to handle some scenarios. If I run all code with-in cluster in Notebook, I don't remember seeing any issues anytime. So I am suspecting either network/scale out events combined with Library 18.2.1 not working as expected.
Appreciate if anyone faced same issues OR share some insight or workarounds to get over this.
Please NOTE: This happens once a while and not always. Re-runs Spark application from AKS goes without errors most of the time
3 weeks ago
Its the remote connection state management issue that occurs when the cluster scales. StatusCode.UNIMPLEMENTED with HTTP2 404 indicates the Databricks Connect client is looking to reach a target like a specific worker node that do not exist after the cluster scale-down events.
You can follow below to reduce the issues
spark.databricks.io.cache.maxRetries 5
spark.databricks.io.cache.timeout 60s
spark.rpc.askTimeout 300s
spark.rpc.lookupTimeout 300s# RPC timeouts
spark.conf.set("spark.rpc.retry.wait", "5s")
spark.conf.set("spark.rpc.numRetries", "5")spark.databricks.clusterUsageTags.autoTerminationMinutes 30Alternatives
3 weeks ago
Short answer: this looks more like an intermittent Spark Connect transport/routing issue than a Spark job logic issue. Databricks Connect uses gRPC over HTTP/2, and the specific InactiveRpcError ... UNIMPLEMENTED ... Received http2 header with status: 404 pattern is consistent with an intermediary returning a non-gRPC HTTP 404 instead of a Spark Connect response.
A few things stand out:
18.2.1 specifically added the 404/reconnect handling youโre expecting; for Python, 18.2.1 is only described as โminor fixes and internal improvements.โ18.1.3 line: the client โautomatically retries transient errors that occur when an intermediary proxy returns a non-gRPC response (for example, HTTP 404โฆ).โ18.2.2 client, and Databricks recommends using the latest version; the runtime version must be greater than or equal to the Connect version.So I would not conclude โlibrary bug only,โ but I also would not dismiss your network / scale-event theory. Similar internal examples show Spark Connect failures where the router endpoint became temporarily unavailable or upstream returned invalid 503, which is very much in the same family of transient transport failures rather than Spark execution failures
databricks-connect 18.2.2 (or newer) and keep the cluster runtime at a compatible version.DatabricksSession.builder.getOrCreate() for Databricks Connect clients._InactiveRpcError / UNAVAILABLE / HTTP-404-on-gRPC-path, rebuild the session, and retry the work unit if it is safe to do so.The safest workaround is to structure the AKS job so each major step can be retried after:
3 weeks ago
Its the remote connection state management issue that occurs when the cluster scales. StatusCode.UNIMPLEMENTED with HTTP2 404 indicates the Databricks Connect client is looking to reach a target like a specific worker node that do not exist after the cluster scale-down events.
You can follow below to reduce the issues
spark.databricks.io.cache.maxRetries 5
spark.databricks.io.cache.timeout 60s
spark.rpc.askTimeout 300s
spark.rpc.lookupTimeout 300s# RPC timeouts
spark.conf.set("spark.rpc.retry.wait", "5s")
spark.conf.set("spark.rpc.numRetries", "5")spark.databricks.clusterUsageTags.autoTerminationMinutes 30Alternatives
3 weeks ago
Short answer: this looks more like an intermittent Spark Connect transport/routing issue than a Spark job logic issue. Databricks Connect uses gRPC over HTTP/2, and the specific InactiveRpcError ... UNIMPLEMENTED ... Received http2 header with status: 404 pattern is consistent with an intermediary returning a non-gRPC HTTP 404 instead of a Spark Connect response.
A few things stand out:
18.2.1 specifically added the 404/reconnect handling youโre expecting; for Python, 18.2.1 is only described as โminor fixes and internal improvements.โ18.1.3 line: the client โautomatically retries transient errors that occur when an intermediary proxy returns a non-gRPC response (for example, HTTP 404โฆ).โ18.2.2 client, and Databricks recommends using the latest version; the runtime version must be greater than or equal to the Connect version.So I would not conclude โlibrary bug only,โ but I also would not dismiss your network / scale-event theory. Similar internal examples show Spark Connect failures where the router endpoint became temporarily unavailable or upstream returned invalid 503, which is very much in the same family of transient transport failures rather than Spark execution failures
databricks-connect 18.2.2 (or newer) and keep the cluster runtime at a compatible version.DatabricksSession.builder.getOrCreate() for Databricks Connect clients._InactiveRpcError / UNAVAILABLE / HTTP-404-on-gRPC-path, rebuild the session, and retry the work unit if it is safe to do so.The safest workaround is to structure the AKS job so each major step can be retried after: