Error: A Database With This Name Was Created by Another Service
Issue
While syncing to a Managed Data Lake Service destination, the connection fails to create a table in the catalog with the following error:
Failed to create table in the catalog: software.amazon.awssdk.services.glue.model.AccessDeniedException: A database with this name was created by another service. Please migrate your Catalog to enable access to this database
Environment
Destination: Managed Data Lake Service
Resolution
To resolve this issue:
- In your AWS account, confirm whether an Athena-managed catalog exists alongside the AWS Glue Data Catalog for the affected region.
- Use the AWS CLI to migrate the Athena-managed catalog to the Glue Data Catalog:
aws glue import-catalog-to-glue --region <region> - Check the migration status:
aws glue get-catalog-import-status --region <region> - Confirm that the response shows
ImportCompleted: true. - Re-run the connection's sync.
- Confirm that subsequent syncs load data without errors.
Cause
This issue occurs when an AWS account has an older, Athena-managed catalog alongside the AWS Glue Data Catalog, and both catalogs contain a database with the same name.
When this happens, the database in the Athena-managed catalog isn't visible through the Glue Data Catalog. Fivetran therefore attempts to create the database through AWS Glue, which detects that the name is already in use by another service. Instead of returning the more descriptive AlreadyExistsException error, AWS Glue returns AccessDeniedException because the database exists outside the catalog Glue is authorized to access.
As a result, we can't create or manage the required tables until you migrate the Athena-managed catalog to the AWS Glue Data Catalog.