

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 疑難排解
<a name="security_iam_fgac-troubleshooting"></a>

## 日誌
<a name="security_iam_fgac-troubleshooting-logging"></a>

EMR on EKS 使用 Spark 資源設定檔來分割任務執行。Amazon EMR on EKS 使用使用者設定檔來執行您提供的程式碼，而系統設定檔則會強制執行 Lake Formation 政策。您可以使用 [MonitoringConfiguration](https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/emr-eks-jobs-s3.html) 設定 StartJobRun 請求，存取以使用者設定檔身分執行的容器日誌。

## Spark 歷史記錄伺服器
<a name="security_iam_fgac-troubleshooting-spark-history"></a>

Spark 歷史記錄伺服器具有從使用者設定檔產生的所有 Spark 事件，以及從系統驅動程式產生的修訂事件。您可以在**執行器**索引標籤中查看來自使用者和系統驅動程式的所有容器。不過，日誌連結僅適用於使用者設定檔。

## 任務失敗，Lake Formation 許可不足
<a name="security_iam_fgac-troubleshooting-job-failed"></a>

請確定您的任務執行角色具有在您存取的資料表`DESCRIBE`上執行 `SELECT`和 的許可。

## 具有 RDD 執行的任務失敗
<a name="security_iam_fgac-troubleshooting-RDD"></a>

EMR on EKS 目前不支援已啟用 Lake Formation 任務的彈性分散式資料集 (RDD) 操作。

## 無法在 Amazon S3 中存取資料檔案
<a name="security_iam_fgac-troubleshooting-unable-access"></a>

請確保已在 Lake Formation 中註冊資料湖的位置。

## 安全驗證例外狀況
<a name="security_iam_fgac-troubleshooting-validation"></a>

EMR on EKS 偵測到安全驗證錯誤。如需協助，請聯絡 AWS 支援。

## 跨帳戶共用 AWS Glue Data Catalog 和資料表
<a name="security_iam_fgac-troubleshooting-across"></a>

可以跨帳戶共用資料庫和資料表，但仍使用 Lake Formation。如需詳細資訊，請參閱 [Lake Formation 中的跨帳戶資料共用](https://docs.aws.amazon.com/lake-formation/latest/dg/cross-account-permissions.html)和[如何使用 AWS Lake Formation 跨帳戶共用 AWS Glue Data Catalog 和資料表？](https://repost.aws/knowledge-center/glue-lake-formation-cross-account)。

## Iceberg 任務擲回初始化錯誤，但未設定 AWS 區域
<a name="security_iam_fgac-troubleshooting-init-error"></a>

訊息如下：

```
25/02/25 13:33:19 ERROR SparkFGACExceptionSanitizer: Client received error with id = b921f9e6-f655-491f-b8bd-b2842cdc20c7, 
reason = IllegalArgumentException, message = Cannot initialize 
LakeFormationAwsClientFactory, please set client.region to a valid aws region
```

確定 Spark 組態`spark.sql.catalog.catalog_name.client.region`設定為有效的區域。

## Iceberg 任務擲回 SparkUnsupportedOperationException
<a name="security_iam_fgac-troubleshooting-unsupported-error"></a>

訊息如下：

```
25/02/25 13:53:15 ERROR SparkFGACExceptionSanitizer: Client received error with id = 921fef42-0800-448b-bef5-d283d1278ce0, 
reason = SparkUnsupportedOperationException, message = Either glue.id or glue.account-id is set with non-default account. 
Cross account access with fine-grained access control is only supported with AWS Resource Access Manager.
```

確定 Spark 組態`spark.sql.catalog.catalog_name.glue.account-id`設定為有效的帳戶 ID。

## Iceberg 任務在 MERGE 操作期間失敗且「403 存取遭拒」
<a name="security_iam_fgac-troubleshooting-merge-s3fileio-error"></a>

訊息如下：

```
software.amazon.awssdk.services.s3.model.S3Exception: Access Denied (Service: S3, Status Code: 403, 
...
	at software.amazon.awssdk.services.s3.DefaultS3Client.deleteObject(DefaultS3Client.java:3365)
	at org.apache.iceberg.aws.s3.S3FileIO.deleteFile(S3FileIO.java:162)
	at org.apache.iceberg.io.FileIO.deleteFile(FileIO.java:86)
	at org.apache.iceberg.io.RollingFileWriter.closeCurrentWriter(RollingFileWriter.java:129)
```

透過新增下列屬性，在 Spark 中停用 S3 刪除操作。 `--conf spark.sql.catalog.s3-table-name.s3.delete-enabled=false`