

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 问题排查
<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 策略。您可以通过配置 StartJobRun 请求来访问作为用户配置文件运行的容器的日志[MonitoringConfiguration](https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/emr-eks-jobs-s3.html)。

## Spark 历史记录服务器
<a name="security_iam_fgac-troubleshooting-spark-history"></a>

Spark History Server 包含从用户配置文件生成的所有 Spark 事件以及从系统驱动程序生成的编辑事件。您可以在**执行程序**选项卡中查看用户和系统驱动程序中的所有容器。但日志链接仅适用于用户配置文件。

## 由于 Lake Formation 权限不足，作业失败
<a name="security_iam_fgac-troubleshooting-job-failed"></a>

确保您的作业执行角色有权在您要访问的表上运行 `SELECT` 和 `DESCRIBE`。

## 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 数据目录和表格
<a name="security_iam_fgac-troubleshooting-across"></a>

您可以跨账户共享数据库和表，且仍可使用 Lake Formation。有关更多信息，请参阅 Lake Formati [on 中的跨账户数据共享和如何使用 AWS Lake](https://docs.aws.amazon.com/lake-formation/latest/dg/cross-account-permissions.html) [Formation 跨账户共享 AWS Glue 数据目录和表格](https://repost.aws/knowledge-center/glue-lake-formation-cross-account)？ 。

## Iceberg Job 在未设置区域时抛出初始化错误 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 Job 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。

## 在 MERGE 操作期间，Iceberg 作业失败并显示“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`。