Ask to ignore harmless error that relates to Scope migration form IDN_OAUTH2_SCOPE to AM_SCOPE and AM_SCOPE_BINDING table while starting APIM server
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 99
- Forks
- 708
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 22
Description
Description:
When migrating to APIM 3.2.0 from an old version, it is migrating scopes in the IDN_OAUTH2_SCOPE & IDN_OAUTH2_SCOPE_BINDING tables to the new AM_SCOPE and AM_SCOPE _BINDING tables. This is happening when starting the APIM server.
In a migration process, if we don't have IS as a KM node. We are running the identity component migration on the APIM node. In that case, if have duplicate entries in the scope IDN_OAUTH2_SCOPE table, it is showing the below error when initializing the APIM component.
ERROR - APIManagerComponent Error while initializing the API manager component
apim-step02-06-migrate-artifacts_1 | org.wso2.carbon.apimgt.api.APIManagementException: Error while saving scopes into db
apim-step02-06-migrate-artifacts_1 | at org.wso2.carbon.apimgt.impl.dao.ScopesDAO.addScopes_aroundBody2(ScopesDAO.java:85) ~[org.wso2.carbon.apimgt.impl_6.7.206.jar:?]
apim-step02-06-migrate-artifacts_1 | at org.wso2.carbon.apimgt.impl.dao.ScopesDAO.addScopes(ScopesDAO.java:56) ~[org.wso2.carbon.apimgt.impl_6.7.206.jar:?]
:
Caused by: java.sql.BatchUpdateException: Subquery returns more than 1 row
apim-step02-06-migrate-artifacts_1 | at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
These duplicate scopes are deleting from the IDN_OAUTH2_SCOPE tables through the APIM component migration client[1].
Therefore the above error can ignore if it is coming when doing the identity component migration. The APIM server is starting for the APIM component migration, and the above error will throw before starting the APIM component migration because the APIM component is activating before executing the APIM component migration.
Then we can ignore this if the APIM component migration is successful.
Solution:
In the migration doc[2], please mention this error in the identity component migration & APIM component migration stages and ask to ignore this as a harmless error.
Suggested Labels:
Suggested Assignees:
Affected Product Version:
APIM 3.2.0
OS, DB, other environment details and versions:
Steps to reproduce:
- Migrate from 2.x series to 3.2.0 with duplicate scopes in IDN_OAUTH2_SCOPE table.
Related Issues:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the linked upgrade guide for APIM 2.6.0 to 3.2.0 and locate the identity and APIM component migration stages; review APIMgtDAO.java around line 385 for the referenced cleanup behavior. Document that this duplicate-scope error can be ignored when the APIM component migration succeeds, and make the affected migration conditions clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100