How to delete duplicate bindings when Cloud Controller enforces uniqueness of Service Bindings
search cancel

How to delete duplicate bindings when Cloud Controller enforces uniqueness of Service Bindings

book

Article ID: 298305

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

When you upgrade to Tanzu Application Service for VMs (TAS for VMs) v2.11, Cloud Controller (CC) introduces a database migration that forces service bindings between service instances and apps to be unique.

If duplicate service bindings exist when you upgrade, the migration fails. This article covers how to delete any duplicate bindings before you upgrade.

Environment

Product Version: 2.11

Resolution

To work around this issue, you must delete any duplicate bindings before you upgrade.

1. SSH to the CF deployment MySQL VM.

2. Connect to the MySQL database. As a superuser run this command to connect to mysql:
 # mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf

3. Target the ccdb database with this command: 
mysql> use ccdb;

4. Run the following query to check for multiple service bindings for the same app and service. 
mysql> select app_guid, service_instance_guid, count(*) from service_bindings group by app_guid,service_instance_guid having count(*) > 1;

5. If the query returns "Empty set" you are clear to proceed with the upgrade. If the query returns any data indicating that there are duplicates found, contact VMware Tanzu Support to help clean up these duplicates.