Uploaded image for project: 'Activiti'
  1. Activiti
  2. ACTIVITI-588

Unable to obtain Activiti SSO user ticket via related REST call when Records Management is installed

    Details

    • ACT Numbers:

      00713082, 00741891

    • Sprint:
      Nightwing 5 - Cluemaster

      Description

      [Description]
      It's not possible to get an Activiti SSO ticket when using the Activiti Share Connector in conjunction with Records Management 2.5. With both these modules installed on Alfresco 5.1.1, and connected to Activiti 1.5, making the REST call for an SSO ticket results in a 500 server error. The same configuration, minus RM 2.5, results in a valid SSO ticket being returned.

      [Steps to reproduce]
      1. Install Alfresco 5.1.1, and Activiti 1.5
      2. Install the Activiti Share Connector 1.5.0 and Records Management 2.5 AMPS on the Alfresco server
      3. Configure Alfresco and Activiti with the documented required configuration: Secret, repository ID, both servers synced to the same LDAP, etc. (https://docs.alfresco.com/activiti/docs/share-guide/1.5.0/#_alfresco_activiti)
      4. Using a REST client, make the following sample call (substitute "kermit" with an LDAP user):

      POST http://alfrescoserver.com/alfresco/service/activiti/sso/alfresco-ticket

      with JSON body

      {
      "secret": "activiti-share-connector-secret",
      "username": "kermit"
      }
      

      NOTE: If you have set a different secret (review property activiti.secret in alfresco-global.properties) you need to adopt the secret value in the JSON body above.

      [Expected Behaviour]
      This call should return a valid ticket for the user:

      {
          "ticket": "TICKET_55344b9020771e6931118ef333abb8faac2dd21a"
      }
      

      See also related documentation:
      https://docs.alfresco.com/activiti/docs/share-guide/1.5.0/#_how_alfresco_activiti_communicates_with_alfresco_one

      [Observed Behaviour]
      No ticket and a 500 server error is returned:

      { 
      "status": { 
      "code": 500, 
      "name": "Internal Error", 
      "description": "An error inside the HTTP server which prevented it from fulfilling the request." 
      }, 
      "message": "08290021 Wrapped Exception (with status template): 08290490 Transaction must be active and synchronization is required: Thread[http-apr-80-exec-8,5,main]", 
      "exception": "", 
      "callstack": [], 
      "server": "Enterprise v5.1.0 (.5 r127092-b59) schema 9,018", 
      "time": "Sep 29, 2016 7:54:05 AM" 
      } 
      

      The relevant stacktrace in Alfresco┬┤s log is the following:

      2016-10-17 09:55:49,251  ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-9] Exception from executeScript - redirecting to status template error: 09170019 Wrapped Exception (with status template): 09170107 Transaction must be active and synchronization is required: Thread[http-apr-8080-exec-9,5,main]
       org.springframework.extensions.webscripts.WebScriptException: 09170019 Wrapped Exception (with status template): 09170107 Transaction must be active and synchronization is required: Thread[http-apr-8080-exec-9,5,main]
      	at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1138)
      	at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:467)
      	at org.alfresco.repo.web.scripts.RepositoryContainer$4.doWork(RepositoryContainer.java:664)
      	at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:555)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:668)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:355)
      	at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308)
      	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:382)
      	at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210)
      	at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	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.alfresco.module.aosmodule.service.ContextRootFilter.doFilter(ContextRootFilter.java:93)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      	at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68)
      	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:220)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
      	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
      	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
      	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.alfresco.error.AlfrescoRuntimeException: 09170107 Transaction must be active and synchronization is required: Thread[http-apr-8080-exec-9,5,main]
      	at org.alfresco.util.transaction.TransactionSupportUtil.registerSynchronizations(TransactionSupportUtil.java:188)
      	at org.alfresco.util.transaction.TransactionSupportUtil.getSynchronization(TransactionSupportUtil.java:172)
      	at org.alfresco.util.transaction.TransactionSupportUtil.getResource(TransactionSupportUtil.java:147)
      	at org.alfresco.repo.transaction.TransactionalResourceHelper.getSet(TransactionalResourceHelper.java:152)
      	at org.alfresco.module.org_alfresco_module_rm.util.TransactionalResourceHelper.getSet(TransactionalResourceHelper.java:97)
      	at org.alfresco.module.org_alfresco_module_rm.securitymarks.permission.SecurityMarksPermissionPreProcessor.process(SecurityMarksPermissionPreProcessor.java:97)
      	at org.alfresco.repo.security.permissions.impl.ExtendedPermissionServiceImpl.hasPermission(ExtendedPermissionServiceImpl.java:155)
      	at org.alfresco.repo.security.person.PersonServiceImpl.personExists(PersonServiceImpl.java:530)
      	at com.activiti.alfresco.sso.AlfrescoTicketPost.executeImpl(AlfrescoTicketPost.java:59)
      	at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
      	... 37 more

      [Supportind evidence]

      • Reproduced issue with latest Activiti 1.5 release, Alfresco 5.1.1 and RM 2.5
      • Issue is not occuring without RM module installed

        TestRail: Results

          Attachments

            Issue Links

              Structure

                Activity

                  People

                  • Assignee:
                    closedbugs Closed Bugs
                    Reporter:
                    dray Dwayne Ray
                  • Votes:
                    0 Vote for this issue
                    Watchers:
                    8 Start watching this issue

                    Dates

                    • Created:
                      Updated:
                      Resolved:

                      Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - 0 minutes
                      0m
                      Logged:
                      Time Spent - 4 hours
                      4h

                        TestRail: Cases

                          Structure Helper Panel