wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
845 stars 785 forks source link

Cannot see the APIs in the migrated API-M 3.0.0 version with DB2 #7189

Closed npamudika closed 4 years ago

npamudika commented 4 years ago

After login to the Publisher or navigating to the DevPortal, the APIs cannot be seen and observed the following error in the console in both the situations. Used DB2 11.5 version as the databases and migrated from the API-M 2.1.0 version.

[2019-12-20 13:02:11,342] ERROR - ApiMgtDAO Failed to retrieve api scopes 
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7;DB2INST1.IDN_OAUTH2_SCOPE, DRIVER=4.26.14
    at com.ibm.db2.jcc.am.b7.a(b7.java:815) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.b7.a(b7.java:66) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.b7.a(b7.java:140) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.ResultSet.completeSqlca(ResultSet.java:4266) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.ResultSet.earlyCloseComplete(ResultSet.java:4248) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.a(ab.java:1642) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.q(ab.java:1607) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.l(ab.java:738) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.d(ab.java:112) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.p.c(p.java:44) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.av.j(av.java:162) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k4.an(k4.java:2256) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.a(k5.java:4666) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.b(k5.java:4182) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.bd(k5.java:780) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.executeQuery(k5.java:745) ~[db2jcc4.jar:?]
    at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) ~[jdbc-pool_9.0.16.wso2v1.jar:?]
    at com.sun.proxy.$Proxy49.executeQuery(Unknown Source) ~[?:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping_aroundBody428(ApiMgtDAO.java:9351) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping(ApiMgtDAO.java:9338) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI_aroundBody2(APIUtil.java:440) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI(APIUtil.java:335) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody194(AbstractAPIManager.java:2699) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2618) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody170(AbstractAPIManager.java:2218) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2122) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.rest.api.publisher.v1.impl.ApisApiServiceImpl.apisGet(ApisApiServiceImpl.java:227) [classes/:?]
    at org.wso2.carbon.apimgt.rest.api.publisher.v1.ApisApi.apisGet(ApisApi.java:801) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8]
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-servlet-api_9.0.22.wso2v1.jar:?]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat_9.0.22.wso2v1.jar:?]
    at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) [org.wso2.carbon.identity.context.rewrite.valve_1.3.6.jar:?]
    at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:100) [org.wso2.carbon.identity.authz.valve_1.3.6.jar:?]
    at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:74) [org.wso2.carbon.identity.auth.valve_1.3.6.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:146) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [tomcat_9.0.22.wso2v1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:116) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat_9.0.22.wso2v1.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.22.wso2v1.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
[2019-12-20 13:02:11,590] ERROR - UserAwareAPIProvider Failed to Search APIs
org.wso2.carbon.apimgt.api.APIManagementException: Failed to retrieve api scopes 
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.handleException_aroundBody328(ApiMgtDAO.java:7344) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.handleException(ApiMgtDAO.java:7342) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping_aroundBody428(ApiMgtDAO.java:9356) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping(ApiMgtDAO.java:9338) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI_aroundBody2(APIUtil.java:440) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI(APIUtil.java:335) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody194(AbstractAPIManager.java:2699) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2618) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody170(AbstractAPIManager.java:2218) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2122) [org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.rest.api.publisher.v1.impl.ApisApiServiceImpl.apisGet(ApisApiServiceImpl.java:227) [classes/:?]
    at org.wso2.carbon.apimgt.rest.api.publisher.v1.ApisApi.apisGet(ApisApi.java:801) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8]
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-servlet-api_9.0.22.wso2v1.jar:?]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat_9.0.22.wso2v1.jar:?]
    at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) [org.wso2.carbon.identity.context.rewrite.valve_1.3.6.jar:?]
    at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:100) [org.wso2.carbon.identity.authz.valve_1.3.6.jar:?]
    at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:74) [org.wso2.carbon.identity.auth.valve_1.3.6.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:146) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [tomcat_9.0.22.wso2v1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:116) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat_9.0.22.wso2v1.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.22.wso2v1.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7;DB2INST1.IDN_OAUTH2_SCOPE, DRIVER=4.26.14
    at com.ibm.db2.jcc.am.b7.a(b7.java:815) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.b7.a(b7.java:66) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.b7.a(b7.java:140) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.ResultSet.completeSqlca(ResultSet.java:4266) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.ResultSet.earlyCloseComplete(ResultSet.java:4248) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.a(ab.java:1642) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.q(ab.java:1607) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.l(ab.java:738) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.d(ab.java:112) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.p.c(p.java:44) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.av.j(av.java:162) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k4.an(k4.java:2256) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.a(k5.java:4666) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.b(k5.java:4182) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.bd(k5.java:780) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.executeQuery(k5.java:745) ~[db2jcc4.jar:?]
    at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) ~[jdbc-pool_9.0.16.wso2v1.jar:?]
    at com.sun.proxy.$Proxy49.executeQuery(Unknown Source) ~[?:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping_aroundBody428(ApiMgtDAO.java:9351) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    ... 61 more
[2019-12-20 13:02:11,623] ERROR - ApisApiServiceImpl Error while retrieving APIs
org.wso2.carbon.apimgt.api.APIManagementException: Failed to Search APIs
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody170(AbstractAPIManager.java:2224) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2122) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.rest.api.publisher.v1.impl.ApisApiServiceImpl.apisGet(ApisApiServiceImpl.java:227) [classes/:?]
    at org.wso2.carbon.apimgt.rest.api.publisher.v1.ApisApi.apisGet(ApisApi.java:801) [classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8]
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-servlet-api_9.0.22.wso2v1.jar:?]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [cxf-rt-transports-http-3.2.8.jar:3.2.8]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat_9.0.22.wso2v1.jar:?]
    at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) [org.wso2.carbon.identity.context.rewrite.valve_1.3.6.jar:?]
    at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:100) [org.wso2.carbon.identity.authz.valve_1.3.6.jar:?]
    at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:74) [org.wso2.carbon.identity.auth.valve_1.3.6.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:146) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [tomcat_9.0.22.wso2v1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:116) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat_9.0.22.wso2v1.jar:?]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat_9.0.22.wso2v1.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.22.wso2v1.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: org.wso2.carbon.apimgt.api.APIManagementException: Failed to retrieve api scopes 
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.handleException_aroundBody328(ApiMgtDAO.java:7344) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.handleException(ApiMgtDAO.java:7342) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping_aroundBody428(ApiMgtDAO.java:9356) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping(ApiMgtDAO.java:9338) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI_aroundBody2(APIUtil.java:440) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI(APIUtil.java:335) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody194(AbstractAPIManager.java:2699) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2618) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody170(AbstractAPIManager.java:2218) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    ... 55 more
Caused by: com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-668, SQLSTATE=57016, SQLERRMC=7;DB2INST1.IDN_OAUTH2_SCOPE, DRIVER=4.26.14
    at com.ibm.db2.jcc.am.b7.a(b7.java:815) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.b7.a(b7.java:66) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.b7.a(b7.java:140) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.ResultSet.completeSqlca(ResultSet.java:4266) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.ResultSet.earlyCloseComplete(ResultSet.java:4248) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.a(ab.java:1642) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.q(ab.java:1607) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.l(ab.java:738) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.ab.d(ab.java:112) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.p.c(p.java:44) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.t4.av.j(av.java:162) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k4.an(k4.java:2256) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.a(k5.java:4666) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.b(k5.java:4182) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.bd(k5.java:780) ~[db2jcc4.jar:?]
    at com.ibm.db2.jcc.am.k5.executeQuery(k5.java:745) ~[db2jcc4.jar:?]
    at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
    at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) ~[jdbc-pool_9.0.16.wso2v1.jar:?]
    at com.sun.proxy.$Proxy49.executeQuery(Unknown Source) ~[?:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping_aroundBody428(ApiMgtDAO.java:9351) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getResourceToScopeMapping(ApiMgtDAO.java:9338) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI_aroundBody2(APIUtil.java:440) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.utils.APIUtil.getAPI(APIUtil.java:335) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody194(AbstractAPIManager.java:2699) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2618) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody170(AbstractAPIManager.java:2218) ~[org.wso2.carbon.apimgt.impl_6.5.349.jar:?]
    ... 55 more
npamudika commented 4 years ago

This issue occurred due to an access restriction to IDN_OAUTH2_SCOPE table.

While running the IS migration client, there is a query execution as below with an ALTER TABLE DROP COLUMN statement.

ALTER TABLE IDN_OAUTH2_SCOPE DROP COLUMN ROLES

Due to that DROP COLUMN query, it needs to do a re-organization for the mentioned table to solve the restriction issue.

The query is as below.

call ADMIN_CMD('REORG table IDN_OAUTH2_SCOPE');

This should be executed against the migrated WSO2_AM_DB.

npamudika commented 4 years ago

The IS migration client has been updated with the fix. We have updated the doc with the latest client too. Hence closing the issue.