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

[OracleDB] Sub organization creation give error for tenants #18626

Closed aaujayasena closed 11 months ago

aaujayasena commented 11 months ago

Describe the issue: Sub organization creation give error for tenants. This is working fine super tenant.

Screencast from 2023-12-15 14_52_58.webm

[2023-12-15 18:12:59,422] [70eeb789-3521-4a83-b3d1-f33cf28d5f31]  INFO {org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent} - Tenant 16 is not initialized correctly. Hence initializing the tenant registry
[2023-12-15 18:12:59,442] [70eeb789-3521-4a83-b3d1-f33cf28d5f31]  INFO {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} - Connected to mount at configregistry in 0ms
[2023-12-15 18:12:59,442] [70eeb789-3521-4a83-b3d1-f33cf28d5f31]  INFO {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} - Connected to mount at govregistry in 1ms
[2023-12-15 18:12:59,456] [70eeb789-3521-4a83-b3d1-f33cf28d5f31]  INFO {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} - Connected to mount at configregistry in 0ms
[2023-12-15 18:12:59,457] [70eeb789-3521-4a83-b3d1-f33cf28d5f31]  INFO {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService} - Connected to mount at govregistry in 1ms
[2023-12-15 18:13:01,238] [70eeb789-3521-4a83-b3d1-f33cf28d5f31]  INFO {org.wso2.carbon.tenant.mgt.services.TenantMgtImpl} - Added the tenant '0c2bad28-04fe-4e0e-96f1-c65175a2867d [16]' by 'admin'
[2023-12-15 18:13:01,332] [70eeb789-3521-4a83-b3d1-f33cf28d5f31] ERROR {org.wso2.carbon.identity.api.server.organization.management.v1.service.OrganizationManagementService} - errorCode: ORG-65090 | message: null org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementServerException: Error while firing the events
at org.wso2.carbon.identity.organization.management.ext.OrganizationManagerListenerImpl.fireEvent(OrganizationManagerListenerImpl.java:162)
at org.wso2.carbon.identity.organization.management.ext.OrganizationManagerListenerImpl.postAddOrganization(OrganizationManagerListenerImpl.java:59)
at org.wso2.carbon.identity.organization.management.service.OrganizationManagerImpl.addOrganization(OrganizationManagerImpl.java:174)
at org.wso2.carbon.identity.api.server.organization.management.v1.service.OrganizationManagementService.addOrganization(OrganizationManagementService.java:237)
at org.wso2.carbon.identity.api.server.organization.management.v1.impl.OrganizationsApiServiceImpl.organizationPost(OrganizationsApiServiceImpl.java:119)
at org.wso2.carbon.identity.api.server.organization.management.v1.OrganizationsApi.organizationPost(OrganizationsApi.java:177)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
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.doPost(AbstractHTTPServlet.java:217)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:555)
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:180)
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.wso2.carbon.identity.event.IdentityEventException: An error occurred while creating shared applications in the new organization
at org.wso2.carbon.identity.organization.management.application.listener.OrganizationCreationHandler.handleEvent(OrganizationCreationHandler.java:78)
at org.wso2.carbon.identity.event.services.IdentityEventServiceImpl.handleEvent(IdentityEventServiceImpl.java:56)
at org.wso2.carbon.identity.organization.management.ext.OrganizationManagerListenerImpl.fireEvent(OrganizationManagerListenerImpl.java:156)
... 60 more
Caused by: org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementServerException: Unable to link the shared application.
at org.wso2.carbon.identity.organization.management.service.util.Utils.handleServerException(Utils.java:112)
at org.wso2.carbon.identity.organization.management.application.dao.impl.OrgApplicationMgtDAOImpl.addSharedApplication(OrgApplicationMgtDAOImpl.java:86)
at org.wso2.carbon.identity.organization.management.application.OrgApplicationManagerImpl.shareApplication(OrgApplicationManagerImpl.java:600)
at org.wso2.carbon.identity.organization.management.application.listener.OrganizationCreationHandler.addSharedApplicationsToOrganization(OrganizationCreationHandler.java:154)
at org.wso2.carbon.identity.organization.management.application.listener.OrganizationCreationHandler.handleEvent(OrganizationCreationHandler.java:76)
... 62 more
Caused by: org.wso2.carbon.database.utils.jdbc.exceptions.TransactionException: Could not commit the transaction.
at org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate.withTransaction(NamedJdbcTemplate.java:105)
at org.wso2.carbon.identity.organization.management.application.dao.impl.OrgApplicationMgtDAOImpl.addSharedApplication(OrgApplicationMgtDAOImpl.java:74)
... 65 more
Caused by: org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException: Error in performing Database query: '%s.' INSERT INTO SP_SHARED_APP (MAIN_APP_ID, OWNER_ORG_ID, SHARED_APP_ID, SHARED_ORG_ID, SHARE_WITH_ALL_CHILDREN) VALUES (:MAIN_APP_ID;, :OWNER_ORG_ID;, :SHARED_APP_ID;, :SHARED_ORG_ID;, :SHARE_WITH_ALL_CHILDREN;);
at org.wso2.carbon.database.utils.jdbc.NamedTemplate.executeInsert(NamedTemplate.java:83)
at org.wso2.carbon.identity.organization.management.application.dao.impl.OrgApplicationMgtDAOImpl.lambda$addSharedApplication$1(OrgApplicationMgtDAOImpl.java:75)
at org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate.withTransaction(NamedJdbcTemplate.java:81)
... 66 more
Caused by: java.sql.SQLException: ORA-03048: SQL reserved word ';' is not syntactically valid following '...( :1 ,  :2 ,  :3 ,  :4 ,  :5 )'

https://docs.oracle.com/error-help/db/ora-03048/
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:702)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:608)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1277)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:1102)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:456)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:482)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:259)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1207)
at oracle.jdbc.driver.OracleStatement.executeSQLStatement(OracleStatement.java:1652)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1417)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3731)
at oracle.jdbc.driver.OraclePreparedStatement.executeLargeUpdate(OraclePreparedStatement.java:3912)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3887)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:993)
at jdk.internal.reflect.GeneratedMethodAccessor64.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.$Proxy54.executeUpdate(Unknown Source)
at org.wso2.carbon.database.utils.jdbc.NamedPreparedStatement.executeUpdate(NamedPreparedStatement.java:266)
at org.wso2.carbon.database.utils.jdbc.NamedTemplate.doInternalUpdate(NamedTemplate.java:246)
at org.wso2.carbon.database.utils.jdbc.NamedTemplate.executeInsert(NamedTemplate.java:76)
... 68 more
Caused by: Error : 3048, Position : 146, SQL = INSERT INTO SP_SHARED_APP (MAIN_APP_ID, OWNER_ORG_ID, SHARED_APP_ID, SHARED_ORG_ID, SHARE_WITH_ALL_CHILDREN) VALUES ( :1 ,  :2 ,  :3 ,  :4 ,  :5 );, Original SQL = INSERT INTO SP_SHARED_APP (MAIN_APP_ID, OWNER_ORG_ID, SHARED_APP_ID, SHARED_ORG_ID, SHARE_WITH_ALL_CHILDREN) VALUES ( ? ,  ? ,  ? ,  ? ,  ? );, Error Message = ORA-03048: SQL reserved word ';' is not syntactically valid following '...( :1 ,  :2 ,  :3 ,  :4 ,  :5 )'

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:710)
... 89 more

at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:710) ... 89 more How to reproduce:

  1. login to management console
  2. Create tenant
  3. Login to console with tenanted path
  4. navigate to organization
  5. Click sub organization
  6. Create sun oraganization

Expected behavior: No error should be available at the create oraganization.

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


Optional Fields

Related issues:

Suggested labels:

sahandilshan commented 11 months ago

This issue was fixed with https://github.com/wso2-extensions/identity-organization-management/pull/320. I think the latest pack still doesn't have the latest organization management jar.

sahandilshan commented 11 months ago

Closing considering the https://github.com/wso2/product-is/issues/18551#issuecomment-1864374485