Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-80661

Cannot log in to SAML after upgrading from version 3.0.0 to 3.1.0 or 3.1.1 - com.liferay.saml.runtime.SamlException: org.hibernate.exception.ConstraintViolationException is thrown sporadically

Details

    Description

      Steps to Reproduce

      1. Set up two servers as SP and IdP with the version 3.0.0 of the Liferay Connector to SAML 2.0 plugin
      2. Log in to the SP to create an entry in the SamlSpSession table
      3. Deploy version 3.1.0/3.1.1 of the Liferay Connector to SAML 2.0 plugin and restart
      4. Attempt to log in to the SP and receive the duplicated primary key exception (Duplicate entry '1' for key 'PRIMARY')

      The issue is due to the change in package name for the SamlSpSession class. Since the package was changed, a new counter is added to the database, the value starts over at 1, and collisions will occur with previously created entries in the SamlSpSession table.

      2018-03-12 00:25:49.988 ERROR [ajp-nio-8009-exec-48][JDBCExceptionReporter:234] Duplicate entry '35114' for key 'PRIMARY'
      2018-03-12 00:25:49.993 ERROR [ajp-nio-8009-exec-48][BaseSamlStrutsAction:54] com.liferay.saml.runtime.SamlException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
      com.liferay.saml.runtime.SamlException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
      	at com.liferay.saml.opensaml.integration.internal.profile.ExceptionHandlerUtil.handleException(ExceptionHandlerUtil.java:34)
      	at com.liferay.saml.opensaml.integration.internal.profile.WebSsoProfileImpl.processResponse(WebSsoProfileImpl.java:172)
      	at com.liferay.saml.web.internal.portlet.action.AssertionConsumerServiceAction.doExecute(AssertionConsumerServiceAction.java:59)
      	at com.liferay.saml.web.internal.portlet.action.BaseSamlStrutsAction.execute(BaseSamlStrutsAction.java:51)
      	at com.liferay.portal.kernel.struts.BaseStrutsAction.execute(BaseStrutsAction.java:39)
      	at com.liferay.portal.struts.ActionAdapter.execute(ActionAdapter.java:50)
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
      	at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:170)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
      	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
      	at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:608)
      	at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:585)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:144)
      

      Attachments

        Issue Links

          Activity

            People

              abel.yu Abel Yu (Inactive)
              jonathan.mccann Jonathan McCann
              Marta Elicegui Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                4 years, 5 weeks, 5 days ago

                Packages

                  Version Package
                  7.0.X
                  7.1.X
                  7.2.X
                  Master