Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.0.X, Master
-
7.2.x, 7.1.x, 7.0.x
-
Committed
-
2
-
4
-
Regression Bug
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)