TKGI v1.20.0 to v1.21.1 upgrade became stuck on the pks-db VM with an error, "Duplicate key name"
search cancel

TKGI v1.20.0 to v1.21.1 upgrade became stuck on the pks-db VM with an error, "Duplicate key name"

book

Article ID: 443638

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

Upgrades from TKGI v1.20.0 to v1.21.1 can fail during the database migration phase within the UAA component. This failure is triggered by a duplicate key error during schema migration.

The deployment logs reported a database migration failure with the following error:

Duplicate key name 'active_and_type_in_zone' (MySQL Error Code: 1061)

Cause

The root cause is frequently related to Flyway database migration conflicts. Flyway, which manages UAA database schema upgrades on startup, may attempt to re-apply migrations that were previously recorded as "deleted" or "failed" in the schema_version table, even if the database schema is already current. This leads to SQL errors (e.g., "#### already exists", or "Duplicate key name") and blocks the application from starting.

Resolution

To resolve this schema conflict, we need to perform data remediation on the underlying database. Please open a support ticket with Tanzu Support so support engineers can safely guide you through this correction process.