Troubleshooting YARN, MapReduce, Hive and Spark Job Failures

Big Data and Hadoop Administrator 16 min min read Updated: Nov 17, 2026 Advanced
Troubleshooting YARN, MapReduce, Hive and Spark Job Failures
Advanced Topic 2 of 3

Where to Look First

QuestionTool
What state is the app in?yarn application -status <appId>, RM UI
Why did it fail?Diagnostics field in app status, then yarn logs -applicationId <appId>
Which container failed and where?RM UI -> app attempt -> container links, NodeManager logs
Was it resource related?NodeManager log lines about memory and container-executor exit codes
How did it behave over time?MapReduce/Spark history server, counters, stages
bash yarn application -status application_1731700000000_0500 | grep -E "State|Diagnostics|Final-State" yarn logs -applicationId application_1731700000000_0500 -log_files_pattern "stderr|syslog" | less yarn applicationattempt -list application_1731700000000_0500 yarn container -list appattempt_1731700000000_0500_000001

Case 1: Application Stuck in ACCEPTED

CauseHow to checkFix
Queue is fullRM scheduler page: used capacity near maxWait, change queue, raise capacity or user limit
AM resource limit reachedmaximum-am-resource-percentRaise the limit, fewer concurrent apps
Container bigger than any nodeRequest > maximum-allocation-mbLower request or raise max
No healthy NodeManagersyarn node -list -allFix unhealthy nodes
Node label mismatchApp asks label with no matching nodesCorrect the label expression
User not allowed in queueACL / queue mappingFix ACLs

Case 2: Container Killed - Exit Codes

Code / messageMeaningFix
Container killed on request. Exit code is 143SIGTERM: YARN killed it (memory limit, preemption, app killed)Check NodeManager log reason line
Exit code 137SIGKILL: OOM killer or forced killCheck dmesg for OOM, reduce container memory sum
running beyond physical memory limits. Current usage: 4.1 GB of 4 GBContainer used too much RAMRaise memory.mb and memoryOverhead, fix leaks
running beyond virtual memory limitsvmem checkDisable vmem-check-enabled or raise ratio
Exit code 1 with OutOfMemoryError: Java heap spaceJVM heap too smallRaise heap (-Xmx), repartition data
Exit code 13 (Spark)Application error in driverRead driver stderr
Exit code -100 / Container released on a *lost* nodeNodeManager lostCheck node health and network
Exit code -104 / Container preempted by schedulerPreemptionExpected, retried; reduce over-capacity use

Case 3: ApplicationMaster Fails

  • Application application_... failed 2 times due to AM Container ... exited with exitCode: 1
  • Look at the AM container log first (yarn logs ... -am 1)
  • Typical causes: missing jar or wrong classpath, no permission on staging directory (/user/<name>/.staging), Kerberos token problems, wrong Java version
bash hdfs dfs -ls -d /user/alice/.staging /user/alice hdfs dfs -chown -R alice:alice /user/alice yarn logs -applicationId application_1731700000000_0500 -am 1 | head -80

Case 4: Slow Job

SymptomLikely causeAction
One reducer/task far longer than othersData skewSalting, better partitioning, skew join settings
Many tasks, each tinySmall filesCombine inputs, compact data
Waiting for containersQueue limits or capacityLook at queue utilisation
High spill, long shuffleMemory or networkRaise sort buffer, compress map output
Executors lost repeatedlyMemory overhead or preemptionIncrease overhead, adjust queue
Task slow on one hostBad disk or noisy neighbourSpeculative execution, blacklist the node, fix hardware

Case 5: Spark Specific

bash # executor lost / FetchFailed yarn logs -applicationId application_... | grep -E "FetchFailed|ExecutorLostFailure|OutOfMemory|Container killed" # Spark UI (via history server): Stages tab -> look for skew in task duration, shuffle read size, spill
MessageMeaning
java.lang.OutOfMemoryError: Java heap space (executor)Raise executor memory or reduce partition size (increase partitions)
java.lang.OutOfMemoryError (driver)collect() or broadcast too big. Raise spark.driver.memory, avoid collecting
org.apache.spark.shuffle.FetchFailedExceptionExecutor or node lost, shuffle service down, or network issue
Job aborted due to stage failure ... Task failed 4 timesRead the first real exception, not the summary
Py4JJavaError / Python worker crashedPython memory (spark.executor.pyspark.memory) or code error

Case 6: Hive Query Failures

ErrorCheck
Vertex failed, vertexName=Map 1 ... Container killedTez container memory, hive.tez.container.size
Failed to open a session / No space leftLocal disk of NodeManager, log dir
Table not found or partitions missingMetastore state, MSCK REPAIR TABLE
HiveAccessControlExceptionRanger policy or HDFS permissions
Lock wait timeout / transactions stuckSHOW TRANSACTIONS, abort aged transactions, compaction health
Query hangsHiveServer2 thread dump (jstack), YARN queue full

A Good Bug Report for Developers

  • Application id, user, queue, time
  • Exact error and the first stack trace in the log
  • Data size and input path
  • Config values (executor memory, partitions)
  • What changed since last success
Educate users: A short wiki page with the 10 most common errors and fixes saves your team many tickets. Link it from the error pages and notebooks.

Conclusion

Start with application status and logs, then match the exit code, container diagnostics or Spark/Hive message to a cause: queue limits, memory, skew, small files, lost nodes or permissions. Fix and share the learning.

Quick Summary: status + logs + exit code -> cause: queue, memory, skew, nodes, perms.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators