dataengref errors

Home / Spark / Shuffle and joins

Spark: MetadataFetchFailedException: Missing an output location for shuffle

org.apache.spark.shuffle.MetadataFetchFailedExceptionMissing an output location for shuffle 3 partition 47

A reducer asked for map output that no longer has a known location, usually because the executor that wrote it was lost. Spark retries the stage, but repeated losses fail the job. Look for why executors died.

Causes · Fixes · Source

Common causes

  1. Executors were killed for memory (YARN or Kubernetes limits) or by preemption, taking their shuffle files with them.How to confirm: Look for "Container killed by YARN" or lost executor messages in the driver log just before this error.
  2. Dynamic allocation removed idle executors that still held shuffle data, without an external shuffle service.How to confirm: spark.dynamicAllocation.enabled is true while spark.shuffle.service.enabled is false and shuffle tracking is off.

How to fix it

Stop executors from dying: give them more memory or overhead, or reduce per-task memory with more partitions.

With dynamic allocation, enable the external shuffle service or shuffle tracking so shuffle data outlives executors.

SettingDefaultNote
spark.shuffle.service.enabledfalse
spark.dynamicAllocation.shuffleTracking.enabledtrue

Where the message comes from

Message template in the source: Missing an output location for shuffle %d partition %d

References

Related errors

Last checked: