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

IDENTITY-6645 Pending approvals will loss when a role contains a list of permission levels #5736

Closed Buddhimah closed 2 weeks ago

Buddhimah commented 5 years ago

Steps to recreate the issue

  1. Create a workflow definition image
  2. Create a workflow association with 'Add Role' user operation and link to above-created workflow definition (association applicable for 'All Requests')
  3. Create a role by adding number of permissions (ex: AdminPermissions -> Login and AdminPersmissions -> Manage section is applied) image Observations

Created role appeared in the management console with workflow icon Role did not list for the pending approvals Following exception observed in the terminal `[2017-10-07 19:07:33,261] WARN {Transaction} - Unexpected exception from afterCompletion; continuing

org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred. FailedObject: org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.PresentationParameter@52679850 at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:594) at org.wso2.carbon.humantask.core.dao.jpa.openjpa.HumanTaskDAOConnectionFactoryImpl$1.afterCompletion(HumanTaskDAOConnectionFactoryImpl.java:79) at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:534) at org.apache.geronimo.transaction.manager.TransactionImpl.afterCompletion(TransactionImpl.java:527) at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:326) at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:238) at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.execTransaction(SimpleScheduler.java:888) at org.wso2.carbon.humantask.core.scheduler.SimpleScheduler.execTransaction(SimpleScheduler.java:828) at org.wso2.carbon.humantask.core.engine.HumanTaskEngine.invoke(HumanTaskEngine.java:99) at org.wso2.carbon.humantask.core.integration.AxisHumanTaskMessageReceiver.invokeBusinessLogic(AxisHumanTaskMessageReceiver.java:81) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146) at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:231) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:124) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:124) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:91) at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:60) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47) at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57) at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47) at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1775) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1734) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.openjpa.persistence.PersistenceException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred. FailedObject: org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.PresentationParameter@52679850 at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2337) at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2174) at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2072) at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1990) at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81) at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1514) at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:933) at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:570) ... 61 more Caused by: org.apache.openjpa.persistence.PersistenceException: Value too long for column "PARAM_VALUE VARCHAR(2000)": "STRINGDECODE('\n\n \n\t\t\t\t\t\t\t\t\t\t\tc57c67e9-4ae6-40cf-b6cd-db1955866f1f,\n\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t... (3990)"; SQL statement: INSERT INTO HT_PRESENTATION_PARAM (id, PARAM_NAME, PARAM_TYPE, PARAM_VALUE, TASK_ID) VALUES (?, ?, ?, ?, ?) [22001-175] {prepstmnt 1339193855 INSERT INTO HT_PRESENTATION_PARAM (id, PARAM_NAME, PARAM_TYPE, PARAM_VALUE, TASK_ID) VALUES (?, ?, ?, ?, ?) [params=?, ?, ?, ?, ?]} [code=22001, state=22001] FailedObject: org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.PresentationParameter@52679850 at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4912) at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4878) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136) at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78) at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143) at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:79) at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:99) at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:87) at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550) at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106) at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:103) at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:713) at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131) ... 68 more Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Value too long for column "PARAM_VALUE VARCHAR(2000)": "STRINGDECODE('\n\n \n\t\t\t\t\t\t\t\t\t\t\tc57c67e9-4ae6-40cf-b6cd-db1955866f1f,\n\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t... (3990)"; SQL statement: INSERT INTO HT_PRESENTATION_PARAM (id, PARAM_NAME, PARAM_TYPE, PARAM_VALUE, TASK_ID) VALUES (?, ?, ?, ?, ?) [22001-175] {prepstmnt 1339193855 INSERT INTO HT_PRESENTATION_PARAM (id, PARAM_NAME, PARAM_TYPE, PARAM_VALUE, TASK_ID) VALUES (?, ?, ?, ?, ?) [params=?, ?, ?, ?, ?]} [code=22001, state=22001] at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:247) at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:223) at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:72) at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1162) at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:272) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1741) at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:267) at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:118) ... 78 more` Note - The reason for the issue should be when adding a role list of assigned permission set will appearing for a pending approval. When the set of permission list is too large following exception will occured. ![image](https://user-images.githubusercontent.com/29881881/59403182-54a6d380-8dbf-11e9-9772-ac25447606e0.png)
madurangasiriwardena commented 5 years ago

Moved from https://wso2.org/jira/browse/IDENTITY-6645

isharak commented 2 weeks ago

This issue is being closed due to extended inactivity. Please feel free to reopen it if further attention is needed. Thank you for helping us keep the issue list relevant and focused!