api-manager icon indicating copy to clipboard operation
api-manager copied to clipboard

Error while creating new Revision of an API

Open karunarathneeshani opened this issue 1 year ago • 0 comments

Description

The below error can be seen when deploying a new revision of the API in case sensitive manner.

TID: [-1234] [api/am/publisher] [2024-04-22 07:38:15,594] ERROR {org.wso2.carbon.apimgt.rest.api.publisher.v1.impl.ApisApiServiceImpl} - Error while adding new API Revision for API : 569a8340-ab80-4038-b7e3-076d8bc62a1b org.wso2.carbon.apimgt.api.APIManagementException: Failed to add API Revision entry of API UUID 569a8340-ab80-4038-b7e3-076d8bc62a1b Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (apim_db.AM_API_PRODUCT_MAPPING, CONSTRAINT AM_API_PRODUCT_MAPPING_ibfk_1 FOREIGN KEY (API_ID) REFERENCES AM_API (API_ID) ON DELETE CASCADE ON UPDATE RESTRICT) Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (apim_db.AM_API_PRODUCT_MAPPING, CONSTRAINT AM_API_PRODUCT_MAPPING_ibfk_1 FOREIGN KEY (API_ID) REFERENCES AM_API (API_ID) ON DELETE CASCADE ON UPDATE RESTRICT)

Steps to Reproduce

  1. Setup APIM 4.1.0.147 with MySQL DB
  2. Deploy sample “PizzaShackAPI” API
  3. By default “/menu” GET resource is available. Add “/meNu” GET resource with the capital-simple difference.
  4. Now, try to deploy a new revision.

Affected Component

APIM

Version

4.1.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response

karunarathneeshani avatar May 21 '24 08:05 karunarathneeshani