wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
748 stars 729 forks source link

Errors when interacting with roles and API Resources - database postgreSQL #18187

Closed ayshsandu closed 11 months ago

ayshsandu commented 12 months ago

Describe the issue: Continuously getting something went wrong errors in the UI when interacting with different flows under ROles such as

image

image

Can see some error logs in the carbon log.

[2023-11-29 16:25:59,911] [2e775bf4-8a4c-4167-8868-e659ceb724f8] ERROR {org.wso2.carbon.identity.api.server.api.resource.v1.util.APIResourceMgtEndpointUtil} - Error while retrieving API resources. org.wso2.carbon.identity.api.resource.mgt.APIResourceMgtServerException: Error while retrieving API resources.
    at org.wso2.carbon.identity.api.resource.mgt.util.APIResourceManagementUtil.handleServerException(APIResourceManagementUtil.java:75)
    at org.wso2.carbon.identity.api.resource.mgt.dao.impl.APIResourceManagementDAOImpl.getAPIResourcesList(APIResourceManagementDAOImpl.java:607)
    at org.wso2.carbon.identity.api.resource.mgt.dao.impl.APIResourceManagementDAOImpl.getAPIResources(APIResourceManagementDAOImpl.java:63)
    at org.wso2.carbon.identity.api.resource.mgt.dao.impl.CacheBackedAPIResourceMgtDAO.getAPIResources(CacheBackedAPIResourceMgtDAO.java:61)
    at org.wso2.carbon.identity.api.resource.mgt.APIResourceManagerImpl.getAPIResources(APIResourceManagerImpl.java:72)
    at org.wso2.carbon.identity.api.server.api.resource.v1.core.ServerAPIResourceManagementService.getAPIResources(ServerAPIResourceManagementService.java:137)
    at org.wso2.carbon.identity.api.server.api.resource.v1.impl.ApiResourcesApiServiceImpl.getAPIResources(ApiResourcesApiServiceImpl.java:101)
    at org.wso2.carbon.identity.api.server.api.resource.v1.ApiResourcesApi.getAPIResources(ApiResourcesApi.java:235)
    at jdk.internal.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201)
    at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:304)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:222)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:529)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:279)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:661)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:425)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:357)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:294)
    at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:147)
    at org.wso2.carbon.identity.context.rewrite.valve.OrganizationContextRewriteValve.invoke(OrganizationContextRewriteValve.java:123)
    at org.wso2.carbon.tomcat.ext.valves.SameSiteCookieValve.invoke(SameSiteCookieValve.java:38)
    at org.wso2.carbon.identity.cors.valve.CORSValve.invoke(CORSValve.java:83)
    at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:179)
    at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:144)
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:110)
    at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
    at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:71)
    at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:152)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670)
    at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:63)
    at org.wso2.carbon.tomcat.ext.valves.RequestEncodingValve.invoke(RequestEncodingValve.java:49)
    at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:137)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1794)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: integer > character varying
  Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
  Position: 130
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2712)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2400)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:367)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:507)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:134)
    at jdk.internal.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:118)
    at com.sun.proxy.$Proxy56.executeQuery(Unknown Source)
    at org.wso2.carbon.identity.api.resource.mgt.dao.impl.APIResourceManagementDAOImpl.getAPIResourcesList(APIResourceManagementDAOImpl.java:593)
    ... 60 more

How to reproduce: Configure Postgres as the database for the Identity and shared data sources (https://is.docs.wso2.com/en/latest/deploy/change-to-postgresql/) Try

Expected behavior: There shouldn't be errors in the UI and functions should work There shouldn't be any errors in the backend

Environment information (Please complete the following information; remove any unnecessary fields) :


Optional Fields

Related issues:

Suggested labels:

ayshsandu commented 12 months ago

Getting similar errors when trying to authorize APIs to an application

image

ZiyamSanthosh commented 11 months ago

We have sent a fix for the similar issue with https://github.com/wso2/carbon-identity-framework/pull/5251 This issue is not reproducible in the pack updated with the fix. Will close once the PR is merged.

https://github.com/wso2/product-is/assets/50801227/946a2903-884b-4fad-9f7d-da7d12d4695b

ZiyamSanthosh commented 11 months ago

This is being tracked with https://github.com/wso2/product-is/issues/18222 Hence closing the issue.