Troubleshooting Glue, EMR and Redshift Workloads
This lesson explains where to look when a pipeline fails or slows down in each processing service, and a systematic approach that applies to all of them.
Learning outcomes
After completing this lesson, you will be able to:
- Troubleshoot Glue jobs with logs, the Spark UI and observability metrics.
- Find EMR logs and application histories.
- Diagnose Redshift queries and loads with EXPLAIN and system tables.
- Apply a systematic troubleshooting approach.
AWS Glue
Start with the job run error, then driver and executor logs in CloudWatch, the Spark UI and observability metrics.
| Problem | Fix |
|---|---|
| Out-of-memory errors | Larger or more workers; repartition |
| Data skew | Repartitioning or salting |
| Many small files | groupFiles or compaction |
| Data reprocessed or skipped | Check job bookmark settings |
| Cannot reach a database | IAM role, KMS key policy, VPC subnet, a security group self-referencing rule, VPC endpoints |
A failing Glue job
Amazon EMR
Amazon EMR clusters run many processes on many nodes, so troubleshooting starts with knowing where each kind of information is kept. Step, container and application logs are archived to Amazon S3, where they remain after the cluster is terminated, which matters for transient clusters that shut down when their work ends. The Spark History Server and the YARN ResourceManager user interface show the stages and tasks of each application, revealing slow stages, skewed tasks and memory errors.
Cluster-level events explain failures that are not caused by the code. Cluster events record Spot interruptions and node failures, which can kill running tasks, and managed scaling metrics explain why capacity rose or fell. A cluster that never reaches the running state often has a failed bootstrap action, a script that runs on each node at start-up, whose log in S3 shows the error.
Troubleshooting EMR
Amazon Redshift
Several tools assist in diagnosing problems with Redshift queries and loads. The following table describes what each tool reveals.
| Tool | Shows |
|---|---|
EXPLAIN | The query plan; large broadcasts or redistributions stand out |
SYS_QUERY_HISTORY, STL and SVL views | Run times and steps |
SYS_LOAD_ERROR_DETAIL / STL_LOAD_ERRORS | Why COPY failed: bad types, delimiters or dates |
STV_LOCKS | Blocking |
| WLM queue metrics | Waiting queries |
SVV_TABLE_INFO | Table skew and unsorted data |
| Redshift Advisor | Suggested fixes |
Troubleshooting Redshift
A general approach
Whatever the service, pipeline failures yield to a systematic approach rather than trial and error. The first step is to reproduce the problem with a small sample of the input, which makes each test run quick and isolates whether the cause lies in the data or in the code.
Next, recent changes to code, schemas or permissions are checked, because most failures in pipelines that used to work follow a change; AWS CloudTrail shows configuration and permission changes, and version control shows code changes. Comparing the failed run with recent successful runs, in input volumes, durations and logs, often points directly to the difference. Finally, once the problem is fixed, monitoring is added so that the next occurrence is detected sooner, ideally before consumers notice.
The following diagram shows the steps of the approach.

A troubleshooting approach
Three failures, three causes
Three pipeline failures each have a distinct cause. The following table identifies the likely cause of each symptom and the appropriate remedy.
| Symptom | Likely cause | Fix |
|---|---|---|
| Glue job fails with out-of-memory on one executor | Data skew or a very large file | Repartition, salt skewed keys, or use larger workers (G.2X) |
| Glue job cannot reach an RDS source | Connection's subnet or security group, or no NAT or S3 endpoint | Fix the Glue connection networking; self-referencing security group rule |
| EMR Spark job runs much longer than usual | Spot task nodes reclaimed, or skew | Check the Spark UI stages; use instance fleets; fix skew |
| Redshift query slow after a large load | Table not vacuumed or analysed; stale statistics | Run (or let auto) VACUUM and ANALYZE |
| Redshift COPY fails | Format mismatch or permissions | Query SYS_LOAD_ERROR_DETAIL; check the IAM role |
The general approach is always the same: read the error or the slowest stage, identify whether it is a data, resource, network or permission problem, then fix the cause rather than adding capacity.
Where are the details of a failed Redshift COPY?
Show answer
In SYS_LOAD_ERROR_DETAIL or STL_LOAD_ERRORS.
Exam Tips
Remember for the exam
- When COPY fails, check SYS_LOAD_ERROR_DETAIL or STL_LOAD_ERRORS.
- When an EMR step fails, read the step logs in S3 and use the Spark History Server.
- For Glue out-of-memory errors or skew, check observability metrics, use bigger workers and repartition.
- When Glue cannot reach a database, check the security group's self-referencing rule, the subnets and the endpoints.
- When Redshift slices are uneven, check skew in SVV_TABLE_INFO and change the distribution key.