API Sync process causes sporadic removal of Portal-published APIs if Gateway 10 CR1 is enrolled with API Portal 4.x.
Portal version(s): API Portal SaaS & On-Prem 4.x
Gateway version(s): API Gateway 10 CR1
The issue appears due to deprecation and removal of JSON V2 schema support from the Validate JSON Assertion used in Portal Sync API Policy from Gateway 10 CR1. In case of on-demand sync, Portal-published APIs will be deleted completely from the enrolled API Gateway during Portal Sync API scheduled task execution. For automatic sync, initial sync causes removal of APIs, while consecutive sync will recreate them again.
Customers are advised to follow the compatibility matrix when enrolling/updating API Gateways. In the case where an upgrade has been performed and a rollback is not possible, you can download the attached revised policy (API_SYNC_POLICY_EXPORT.xml and API_PLAN_SYNC_FIX.xml). Manually install the files through the Policy Manager to restore API sync functionality.
Alternatively, the following commands can be run against the target API Gateway to install policy update bundle (API_SYNC_POLICY_BUNDLE.xml):
curl -X PUT https://<GATEWAY_HOST>:<GATEWAY_PORT>/restman/1.0/bundle -u"<ADMIN_USERNAME>:<ADMIN_PASSWORD>" -k -H"Content-type:application/xml" --data-binary @API_SYNC_POLICY_BUNDLE.xml
If you have API Plans enabled, run this command to fix API Plan sync:
curl -X PUT https://<GATEWAY_HOST>:<GATEWAY_PORT>/restman/1.0/bundle -u"<ADMIN_USERNAME>:<ADMIN_PASSWORD>" -k -H"Content-type:application/xml" --data-binary @api_plan_sync_fix.xml
Note: All customizations of the API Sync Policy will be overwritten and have to be reapplied.