Skip to content

Commit 7b90f93

Browse files
20250227 edit pass
1 parent 9ecd61d commit 7b90f93

16 files changed

+106
-117
lines changed
Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,55 @@
11
---
2-
title: Handle Livy errors on Apache Spark in Synapse
2+
title: Handle Livy Errors on Apache Spark in Synapse
33
description: Learn how to handle and interpret job failures on Apache Spark in Synapse Analytics.
44
author: Niharikadutta
5+
ms.author: nidutta
6+
ms.date: 02/27/2025
57
ms.service: azure-synapse-analytics
6-
ms.topic: error-reference
78
ms.subservice: spark
8-
ms.date: 08/29/2022
9-
ms.author: nidutta
9+
ms.topic: error-reference
1010
---
1111

1212
# Interpret error codes in Synapse Analytics
1313

14-
There are many factors that can play into why a spark application fails in Azure Synapse Analytics today. For instance, it can be due to a system error or even a user related error. Previously, all errors corresponding to failing jobs on
15-
Synapse Analytics were surfaced with a generic error code displaying *LIVY_JOB_STATE_DEAD*. This error code gave no further insight into why the job has failed. It requires significant effort to identify the root cause by digging into the driver, executor, Spark Event, Livy logs, and find a resolution.
14+
There are many factors that can play into why a spark application fails in Azure Synapse Analytics today. For instance, it can be due to a system error or even a user related error. Previously, all errors corresponding to failing jobs on Synapse Analytics were surfaced with a generic error code displaying *LIVY_JOB_STATE_DEAD*. This error code gave no further insight into why the job failed. It requires significant effort to identify the root cause by digging into the driver, executor, Spark Event, Livy logs, and find a resolution.
1615

17-
:::image type="content" source="./media/apache-spark-error-classification/apache-spark-old-error-view.png" alt-text="Screenshot of Apache Spark error code without detailed message." lightbox="./media/apache-spark-error-classification/apache-spark-old-error-view.png" border="true":::
16+
:::image type="content" source="media/apache-spark-handle-livy-error/apache-spark-old-error-view.png" border="true" alt-text="Screenshot of Apache Spark error code without detailed message." lightbox="media/apache-spark-handle-livy-error/apache-spark-old-error-view.png":::
1817

1918
We have introduced a more precise list of error codes that replaces the previous generic message. The new message describes the cause of failure. Whenever a job fails on Azure Synapse Analytics, the error handling feature parses and checks the logs on the backend to identify the root cause. It then displays a message to the user on the monitoring pane along with the steps to resolve the issue.
2019

21-
:::image type="content" source="./media/apache-spark-error-classification/apache-spark-new-error-view.png" alt-text="Screenshot of Apache Spark error code with detailed message." lightbox="./media/apache-spark-error-classification/apache-spark-new-error-view.png" border="true":::
20+
:::image type="content" source="media/apache-spark-handle-livy-error/apache-spark-new-error-view.png" border="true" alt-text="Screenshot of Apache Spark error code with detailed message." lightbox="media/apache-spark-handle-livy-error/apache-spark-new-error-view.png":::
2221

2322
## Enable error classification in Synapse
2423

2524
The error classification feature can be enabled or disabled by setting the following Spark configuration to `true` or `false` at the job or pool level:
2625

2726
`livy.rsc.synapse.error-classification.enabled`
2827

29-
The following section lists some error types that are currently supported. We are continuously refining and adding more to these error codes by improving our model.
28+
The following section lists some error types that are currently supported. We're continuously refining and adding more to these error codes by improving our model.
3029

3130
## Error code categories
3231

3332
Each error code falls under one of the following four buckets:
3433

3534
1. **User** - Indicating a user error
36-
2. **System** - Indicating a system error
37-
3. **Ambiguous** - Could be either user or system error
38-
4. **Unknown** - No classification yet, most probably because the error type isn't included in the model
35+
1. **System** - Indicating a system error
36+
1. **Ambiguous** - Could be either user or system error
37+
1. **Unknown** - No classification yet, most probably because the error type isn't included in the model
3938

4039
## Error code examples for each classification type
4140

4241
### Spark_User_TypeError_TypeNotIterable
4342

4443
In Python, the error `TypeError: argument of type 'insert type' is not iterable` occurs when the membership operator (in, not in) is used to validate the membership of a value in non iterable objects such as list, tuple, dictionary. This is usually due to the search of value in a non-iterable object. Possible solutions:
4544

46-
* Check if the value is present in the iterable object.
47-
* If you want to check one value to another, use logical operator instead of Membership Operator.
48-
* If the membership operator contains "None" value, it won't be able to iterate, and a null check or assigned default must be done.
49-
* Check if the type of the value used can actually be checked and the typing is correct.
45+
- Check if the value is present in the iterable object.
46+
- If you want to check one value to another, use logical operator instead of Membership Operator.
47+
- If the membership operator contains "None" value, it won't be able to iterate, and a null check or assigned default must be done.
48+
- Check if the type of the value used can actually be checked and the typing is correct.
5049

5150
### Spark_System_ABFS_OperationFailed
5251

53-
An operation with ADLS Gen2 has failed.
52+
An operation with Azure Data Lake Storage (ADLS) Gen2 has failed.
5453

5554
This error occurs typically due to a permissions issue.
5655

@@ -59,22 +58,18 @@ Check the logs for this Spark application. Navigate to your Synapse Studio, sele
5958

6059
### Spark_Ambiguous_ClassLoader_NoClassDefFound
6160

62-
A class required by the code could not be found when the script was run.
61+
A class required by the code couldn't be found when the script was run. For more information, see:
6362

64-
Please refer to the following pages for package management documentation:
63+
- For Notebook scenarios: [Apache Spark manage packages for interactive jobs](./apache-spark-manage-scala-packages.md)
64+
- For Spark batch scenarios (see section 6): [Apache Spark manage packages for batch jobs](./apache-spark-job-definitions.md#create-an-apache-spark-job-definition-for-apache-sparkscala)
6565

66-
For Notebook scenarios: [Apache Spark manage packages for interactive jobs](./apache-spark-manage-scala-packages.md)
67-
68-
For Spark batch scenarios (see section 6): [Apache Spark manage packages for batch jobs](./apache-spark-job-definitions.md#create-an-apache-spark-job-definition-for-apache-sparkscala)
69-
70-
Ensure that all the code dependencies are included in the JARs Synapse runs. If you do not or cannot include third party JARs with your own code, ensure that all dependencies are included in the workspace packages for the Spark pool you are executing code on, or they are included in the "Reference files" listing for the Spark batch submission. See the above documentation for more information.
66+
Ensure that all the code dependencies are included in the JARs Synapse runs. If you do not or cannot include third party JARs with your own code, ensure that all dependencies are included in the workspace packages for the Spark pool you are executing code on, or they are included in the "Reference files" listing for the Spark batch submission.
7167

7268
### Spark_Unknown_Unknown_java.lang.Exception
7369

7470
An unknown failure, the model wasn't able to classify.
7571

76-
77-
The error codes (including and beyond the list shown above) along with the troubleshooting instructions on how to resolve the issue will show up on the Synapse Studio application error pane if this feature is enabled.
72+
The error codes (including and beyond the previous list) along with the troubleshooting instructions on how to resolve the issue will show up on the Synapse Studio application error pane if this feature is enabled.
7873

7974
> [!NOTE]
80-
> If you built any tooling around the Synapse monitoring job that checks for a failing job by filtering the `LIVY_JOB_STATE_DEAD` error code, your app would no longer work. Because the returned error codes would be different as mentioned above. Modify any scripts accordingly in order to utilize this feature or disable the feature if it's not needed.
75+
> If you built any tooling around the Synapse monitoring job that checks for a failing job by filtering the `LIVY_JOB_STATE_DEAD` error code, your app would no longer work. Because the returned error codes are different. Modify any scripts accordingly in order to utilize this feature or disable the feature if it's not needed.

0 commit comments

Comments
 (0)