1
votes

We are using WSO2 APIM 2.1 with PostgreSQL using docker container and import export .war file. I tried to upgrade by downloading latest version(3.0) and api-import-export-3.0.0-m33.war but It was not able to load import export war. So I tried to upgrade to APIM 2.6.0, in that, it could work with wso2am-2.6.0.zip and api-import-export-2.6.0-v2.war. after changing it to postgres db, As per WSO2 documents, I changed password, truststore and keystore in all config files. But Now I am getting below errors.

ERROR:  relation "idn_oidc_scope" does not exist at character 23
ccc-api-db       | STATEMENT:  SELECT COUNT(ID) FROM IDN_OIDC_SCOPE WHERE TENANT_ID=$1
ccc-apim         | [2020-01-14 10:18:11,832] ERROR - OAuth2ServiceComponent Error while activating OAuth2ServiceComponent.
ccc-apim         | org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception: Error while loading the top scope id for the tenant: -1234
ccc-apim         |  at org.wso2.carbon.identity.openidconnect.dao.ScopeClaimMappingDAOImpl.hasScopesPopulated(ScopeClaimMappingDAOImpl.java:300)
ccc-apim         |  at org.wso2.carbon.identity.oauth2.internal.OAuth2ServiceComponent.activate(OAuth2ServiceComponent.java:98)
ccc-apim         |  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
ccc-apim         |  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
ccc-apim         |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
ccc-apim         |  at java.lang.reflect.Method.invoke(Method.java:498)

and

ccc-api-db       | ERROR:  relation "mb_dtx_xid" does not exist at character 45
ccc-api-db       | STATEMENT:  SELECT FORMAT_CODE,BRANCH_ID,GLOBAL_ID FROM MB_DTX_XID
ccc-apim         | [2020-01-14 10:18:43,092] ERROR - ApplicationRegistry org.wso2.andes.kernel.AndesException: Error occurred while recovering DtxBranch 
ccc-apim         | [2020-01-14 10:18:43,093] ERROR - Main Exception during startup. Triggering shutdown 
ccc-apim         | org.wso2.andes.kernel.AndesException: Unable to initialise application registry
ccc-apim         |  at org.wso2.andes.server.Broker.startupImpl(Broker.java:307)
ccc-apim         |  at org.wso2.andes.server.Broker.startup(Broker.java:110)
ccc-apim         |  at org.wso2.andes.server.Main.startBroker(Main.java:217)
ccc-apim         |  at org.wso2.andes.server.Main.execute(Main.java:206)
ccc-apim         |  at org.wso2.andes.server.Main.<init>(Main.java:54)
ccc-apim         |  at org.wso2.andes.server.Main.main(Main.java:47)
ccc-apim         |  at org.wso2.carbon.andes.internal.QpidServiceComponent.startAndesBroker(QpidServiceComponent.java:396)

These tables were not in APIM 2.1.0. It is part of 2.6.0 it seems. But I am not sure about these errors and no idea about tenant -1234.

Any help in this will be helpful.

Also let us know with which version APIM 3.0 is compatible of for import-export war file?

2

2 Answers

0
votes

There have been MB store db script changes from APIM 2.1 to 2.6. So make sure you followed step 5 under "Step 2 - Upgrade WSO2 API-M 2.1.0 to 2.6.0" in this migration doc https://docs.wso2.com/display/AM260/Upgrading+from+the+Previous+Release#210. It will fix below error you faced.

ERROR:  relation "mb_dtx_xid" does not exist at character 45

There have been IDN db script changes from APIM 2.1 to 2.6. So make sure you followed step 6 under "Step 2 - Upgrade WSO2 API-M 2.1.0 to 2.6.0" in this migration doc https://docs.wso2.com/display/AM260 /Upgrading+from+the+Previous+Release#210. It will fix below error you faced.

relation "idn_oidc_scope" does not exist at character 23

Answering your other query, -1234 is the tenant id of super tenant carbon.super

0
votes

APIM 2.6.0 the compatible version for the import-export tool is "api-import-export-2.6.0-v14.war"[1]. In APIM 3.0.0, you can follow this document[2] to do this.

[1]. https://docs.wso2.com/display/AM260/Migrating+the+APIs+to+a+Different+Environment [2]. https://apim.docs.wso2.com/en/next/Learn/APIController/migrating-apis-to-different-environments/