Log EMR cluster StateChangeReason on transient mode failure#100
Conversation
In transient mode (run-transient) the cluster is launched with its steps embedded and the runner only waits for it to terminate. When the cluster terminates with errors — provisioning, quota, IAM or networking errors, or a bootstrap failure — the ClusterTerminatedWaiter returns a generic "transitioned to Failure" error and the underlying StateChangeReason was never surfaced, leaving transient runs blind to why the cluster died. On waiter failure, re-describe the cluster and surface Cluster.Status.StateChangeReason Code and Message both in the logs and in the returned error, mirroring the persistent path added in #98.
|
The following is unashamedly copy and pasted out of a conversation with Claude. See if you think these are legitimate complaints: One thing worth considering before we close this off: when a step fails (rather than the cluster failing to provision), EMR terminates the cluster with A couple of smaller things:
|
|
OK thanks for checking. It seems Claude was wrong on this one. The logs you are shared are exactly what we need. |


In transient mode (run-transient) the cluster is launched with its steps embedded and the runner only waits for it to terminate. When the cluster terminates with errors — provisioning, quota, IAM or networking errors, or a bootstrap failure — the ClusterTerminatedWaiter returns a generic "transitioned to Failure" error and the underlying StateChangeReason was never surfaced, leaving transient runs blind to why the cluster died.
On waiter failure, re-describe the cluster and surface Cluster.Status.StateChangeReason Code and Message both in the logs and in the returned error, mirroring the persistent path added in #98.
ref: https://snplow.atlassian.net/browse/PDP-2682