While running a bulk sync, the Application API Keys go in error state
API Portal 5.2+
The issue is with the Applications that were created using the legacy API model (usually migrated through product upgrades) and have a custom field value set as NULL.
1. Before proceeding, run a backup of the Portal Database.
2. Retrieve a list of Applications that have a NULL Custom Field value by executing the following query against 'portal' DB (take note of the Tenant's name from the output as we will use it in step 3)
SELECT * FROM portal.CUSTOM_FIELD_VALUE WHERE VALUE IS NULL;
3. Run the following SQL query to update the Custom Field value from NULLvalue with a random "zxy" value
UPDATE `portal`.`CUSTOM_FIELD_VALUE` SET `VALUE` = 'xyz' WHERE (`TENANT_ID` = '<TENANT_NAME>') and VALUE IS NULL;
4. Re-run the bulk-sync by flipping the proxy from automatic to on-demand and automatic again.