Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while creating new Revision of an API ( When using MSSQL databases ) #2999

Closed
dinuka10 opened this issue Jul 10, 2024 · 0 comments · Fixed by wso2/carbon-apimgt#12505
Closed

Comments

@dinuka10
Copy link

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.2.0.95 with MSSQL 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

wso2am-4.2.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants