

# Troubleshooting integrations with Amazon S3 Tables

**Important**  
This is preview documentation for the Aurora PostgreSQL integration with Amazon S3 Tables. Before using this capability, review the Betas and Previews terms in the [AWS Service Terms](https://aws.amazon.com/service-terms/).

Use the following information to diagnose and resolve common problems with an Aurora PostgreSQL integration with Amazon S3 Tables. Start by checking the integration status and the per-table status to find where the problem is. For more information, see [Integration statuses](s3tables-integration.monitoring.md#s3tables-integration.monitoring.statuses) and [Per-table status](s3tables-integration.monitoring.md#s3tables-integration.monitoring.per-table-status).

**Topics**
+ [I cannot create an integration with Amazon S3 Tables](#s3tables-integration.troubleshooting.create)
+ [My integration is not reaching the `active` status](#s3tables-integration.troubleshooting.not-active)
+ [My integration has a status of `needs_attention`](#s3tables-integration.troubleshooting.needs-attention)
+ [My integration has a status of `failed`](#s3tables-integration.troubleshooting.failed)
+ [A table is not being replicated](#s3tables-integration.troubleshooting.table)
+ [Data is missing or delayed](#s3tables-integration.troubleshooting.delayed)
+ [Replication stopped after an Aurora Global Database switchover or failover](#s3tables-integration.troubleshooting.global-database)

## I cannot create an integration with Amazon S3 Tables
<a name="s3tables-integration.troubleshooting.create"></a>

If you cannot create an integration with Amazon S3 Tables, check for the following causes.

**Enhanced logical replication is not turned on:** Confirm that `rds.logical_replication` and `aurora.enhanced_logical_replication` both read `on` at runtime, and that `aurora.logical_replication_backup` and `aurora.logical_replication_globaldb` are set to `0` in the DB cluster parameter group. You must set these parameters in a custom DB cluster parameter group. They take effect only after you reboot the primary DB instance. Reboot the primary DB instance, and then check the values again before you create the integration. For more information, see [Step 1: Create a custom DB cluster parameter group](zero-etl.setting-up.md#zero-etl.parameters).

**The table bucket resource policy is missing or incorrect:** If the table bucket has no resource policy, or the policy does not grant access to the Amazon RDS service principal `export.rds.amazonaws.com`, `create-integration` fails. It returns an `InvalidParameterCombination` error with the following message:

"Unable to access target table bucket. Verify that the bucket exists and that its resource policy grants access to the RDS service principal."

When you create the integration, the integration checks only that it can read the bucket. A policy that is missing other required actions can still pass this check, and replication fails later. The affected tables then enter the `FAILED` state with the reason `TARGET_ACCESS_DENIED`, and Aurora sends RDS-EVENT-0589. Confirm that the policy grants every action in [Creating the table bucket and resource policy](zero-etl.setting-up.md#s3tables-integration.setting-up.bucket-policy).

**The engine version is not supported:** Confirm that the source DB cluster runs a supported Aurora PostgreSQL engine version. For supported versions, see [Aurora PostgreSQL zero-ETL integrations](Concepts.Aurora_Fea_Regions_DB-eng.Feature.Zero-ETL.md#Concepts.Aurora_Fea_Regions_DB-eng.Feature.Zero-ETL-Postgres).

**The AWS KMS key is not accessible:** If the key policy of the integration's AWS Key Management Service (AWS KMS) key denies your use of the key through Amazon RDS, `create-integration` fails with `KMSKeyNotAccessibleFault`. The error message includes the key's Amazon Resource Name (ARN). For the key policy, see [Customer managed key for the integration](s3tables-integration.security.md#s3tables-integration.security.integration-key).

If the source DB cluster is encrypted with a customer managed key, `create-integration` also checks that you can use that key. For its key policy, see [Customer managed key for the source DB cluster](s3tables-integration.security.md#s3tables-integration.security.cluster-key).

## My integration is not reaching the `active` status
<a name="s3tables-integration.troubleshooting.not-active"></a>

Confirm that you set up the source DB cluster and the target table bucket. For instructions, see [Getting started with Aurora zero-ETL integrations](zero-etl.setting-up.md) and [Step 3c: Create a target Amazon S3 Tables table bucket](zero-etl.setting-up.md#s3tables-integration.setting-up).

If you created several integrations from the same source DB cluster at the same time, each one can take longer to reach `active`. For other factors that affect how long an integration takes to reach `active`, see [Integration statuses](s3tables-integration.monitoring.md#s3tables-integration.monitoring.statuses).

## My integration has a status of `needs_attention`
<a name="s3tables-integration.troubleshooting.needs-attention"></a>

An integration has a status of `needs_attention` when it cannot continue until you fix a problem in your account. For the causes, see [Integration statuses](s3tables-integration.monitoring.md#s3tables-integration.monitoring.statuses).

**To recover an integration that has a status of `needs_attention`**

1. Find the cause. Check the events for the integration, such as RDS-EVENT-0589 for lost access to the target table bucket, or RDS-EVENT-0588 for a problem with a AWS KMS key. For more information, see [Events](s3tables-integration.monitoring.md#s3tables-integration.monitoring.events).

1. Check the per-table status to find the affected tables. For more information, see [Per-table status](s3tables-integration.monitoring.md#s3tables-integration.monitoring.per-table-status).

1. Fix the cause. For example, restore access to the target table bucket or to the AWS KMS key named in the event.

1. Resync the integration. For instructions, see [Resyncing integrations with Amazon S3 Tables](s3tables-integration.resyncing.md).

## My integration has a status of `failed`
<a name="s3tables-integration.troubleshooting.failed"></a>

An integration has a status of `failed` when it encounters an error that it cannot recover from. For the causes, see [Integration statuses](s3tables-integration.monitoring.md#s3tables-integration.monitoring.statuses). You cannot resync an integration in this status. Instead, delete the integration and create a new one.

For instructions, see [Deleting integrations with Amazon S3 Tables](s3tables-integration.deleting.md) and [Recreating an integration](s3tables-integration.deleting.md#s3tables-integration.deleting.recreate).

## A table is not being replicated
<a name="s3tables-integration.troubleshooting.table"></a>

Check the per-table status. A table that cannot be replicated has a per-table state of `FAILED` and a `status_reason` value that explains why. (The per-table state `FAILED` is different from the integration status `failed`.) For each `status_reason` value and what to do about it, see [Per-table status](s3tables-integration.monitoring.md#s3tables-integration.monitoring.per-table-status).

The following are common causes:
+ **The source table has no primary key:** Each replicated table needs a valid primary key. For the primary key rules, see [Aurora PostgreSQL table limitations](zero-etl.reqs-lims.md#s3tables-integration.limitations.tables). Aurora checks for a primary key during the initial full sync and when you create a table on an active integration. A table without one enters the `FAILED` state with the reason `SOURCE_TABLE_MISSING_PRIMARY_KEY`. (If the table also has a column of an unsupported type, the reason shown is `SOURCE_UNSUPPORTED_TYPE`.) To fix it, add a primary key at the source, and the integration resyncs the table automatically. If another problem remains, such as an unsupported column type, the table returns to `FAILED` until you fix that problem too.
+ **The source object is not supported:** The object is a type that the integration does not replicate. For the list, see [Aurora PostgreSQL table limitations](zero-etl.reqs-lims.md#s3tables-integration.limitations.tables).
+ **A value is larger than 100 MB:** The `status_detail` value names the column and the supported maximum size. Reduce the value on the source. For the quota, see [Quotas](zero-etl.quotas.md#s3tables-integration.limitations.quotas).
+ **The primary key was dropped from a table that was replicating:** Add the primary key back at the source. The integration then resyncs the table automatically. If a data rule excluded the key column, the reason is `SOURCE_PK_FILTERED` instead. In that case, change the data rule so that it includes the key column. If the key column holds sensitive data, do not include it. A table cannot replicate while a data rule excludes part of its primary key. Define a primary key on non-sensitive columns at the source, or exclude the table.

## Data is missing or delayed
<a name="s3tables-integration.troubleshooting.delayed"></a>

If data does not appear in the target, or appears later than you expect, check the following:
+ A change appears in the target within a few minutes. For more information, see [How replication works](s3tables-integration.md#s3tables-integration.how-it-works).
+ A table that is resyncing catches up before it returns to `SYNCED`. For more information, see [Resyncing integrations with Amazon S3 Tables](s3tables-integration.resyncing.md).
+ A column is missing from the target. If you excluded the column with a data rule, it is not replicated. The integration does not skip a column that has an unsupported data type. Instead, replication of the whole table fails with the reason `SOURCE_UNSUPPORTED_TYPE`. For more information, see [Unsupported types and values](s3tables-integration.data-type-mapping.md#s3tables-integration.data-type-mapping.unsupported).
+ A query in Amazon Athena fails with the error `GENERIC_INTERNAL_ERROR: Get table request failed: com.amazonaws.services.glue.model.ValidationException: Unsupported Federation Resource - Invalid table or column names`. Target column names keep the case they have at the source. AWS Glue Data Catalog and AWS Lake Formation do not support tables whose definitions contain uppercase letters, including uppercase column names, so AWS analytics services such as Athena cannot see these tables. To fix this, rename the column to lowercase at the source, or query the table with an engine that reads it directly instead of through the AWS Glue Data Catalog, such as Apache Spark. For more information, see [Naming rules for tables and namespaces](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-buckets-naming.html#naming-rules-table) in the *Amazon Simple Storage Service User Guide*, [Column names](s3tables-integration.data-organization.md#s3tables-integration.data-organization.columns), and [Querying with Apache Spark](s3tables-integration.querying.md#s3tables-integration.querying.spark).
+ A full sync or change data capture (CDC) is slower than you expect. Check the `ReplicationLag` metric and the per-table status. For more information, see [Metrics](s3tables-integration.monitoring.md#s3tables-integration.monitoring.metrics) and [Per-table status](s3tables-integration.monitoring.md#s3tables-integration.monitoring.per-table-status).

## Replication stopped after an Aurora Global Database switchover or failover
<a name="s3tables-integration.troubleshooting.global-database"></a>

If the source DB cluster is in an Aurora Global Database, a cross-Region switchover or failover stops replication. Logical replication state does not transfer across Regions in a global database, so the integration cannot resume against the new primary DB cluster.

To resume replication, delete the integration and create a new one against the new primary DB cluster in its Region. For instructions, see [Deleting integrations with Amazon S3 Tables](s3tables-integration.deleting.md). For the other Aurora operations that affect an integration, see [Aurora operations that affect an integration](zero-etl.reqs-lims.md#s3tables-integration.limitations.operations).