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

PortalConfigurationCORSClientTest.testNoCORSUsingPortalSession no valid CSRF token

    Details

      Description

      PortalConfigurationCORSClientTest.testNoCORSUsingPortalSession integration test fails with:

           [exec] com.liferay.portal.remote.cors.client.test.PortalConfigurationCORSClientTest > testNoCORSUsingPortalSession STARTED
           [exec] 2021-03-22 21:27:22.604 ERROR [http-nio-8080-exec-8][JSONAction:90] User 0 did not provide a valid CSRF token for com.liferay.portal.jsonwebservice.JSONWebServiceServiceAction:/user/get-current-user
           [exec] 
           [exec] com.liferay.portal.remote.cors.client.test.PortalConfigurationCORSClientTest > testNoCORSUsingPortalSession FAILED
           [exec]     java.lang.AssertionError: Thread Thread[http-nio-8080-exec-8,5,main] caught concurrent failure: java.lang.AssertionError: {level=ERROR, loggerName=com.liferay.portal.struts.JSONAction, message=User 0 did not provide a valid CSRF token for com.liferay.portal.jsonwebservice.JSONWebServiceServiceAction:/user/get-current-user
           [exec]     java.lang.AssertionError: {level=ERROR, loggerName=com.liferay.portal.struts.JSONAction, message=User 0 did not provide a valid CSRF token for com.liferay.portal.jsonwebservice.JSONWebServiceServiceAction:/user/get-current-user
           [exec]     	at com.liferay.portal.test.rule.LogAssertionTestRule$LogAppender.append(LogAssertionTestRule.java:330)
           [exec]     	at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
           [exec]     	at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
           [exec]     	at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
           [exec]     	at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:540)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:498)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:481)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.logParent(LoggerConfig.java:531)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:500)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:481)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.logParent(LoggerConfig.java:531)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:500)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:481)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.logParent(LoggerConfig.java:531)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:500)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:481)
           [exec]     	at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:456)
           [exec]     	at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:82)
           [exec]     	at org.apache.logging.log4j.core.Logger.log(Logger.java:161)
           [exec]     	at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2205)
           [exec]     	at org.apache.logging.log4j.spi.AbstractLogger.logMessageTrackRecursion(AbstractLogger.java:2159)
           [exec]     	at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2142)
           [exec]     	at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1994)
           [exec]     	at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1852)
           [exec]     	at com.liferay.portal.log.Log4jLogImpl.error(Log4jLogImpl.java:52)
           [exec]     	at com.liferay.portal.kernel.log.LogWrapper.error(LogWrapper.java:59)
           [exec]     	at com.liferay.portal.struts.JSONAction.execute(JSONAction.java:90)
           [exec]     	at com.liferay.portal.servlet.JSONServlet.service(JSONServlet.java:63)
           [exec]     	at com.liferay.portal.jsonwebservice.JSONWebServiceServlet.service(JSONWebServiceServlet.java:63)
           [exec]     	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
           [exec]     	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
           [exec]     	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
           [exec]     	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
           [exec]     	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
           [exec]     	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:124)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)
           [exec]     	at com.liferay.portal.servlet.filters.authverifier.AuthVerifierFilter.processFilter(AuthVerifierFilter.java:214)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
           [exec]     	at com.liferay.portal.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:62)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
           [exec]     	at com.liferay.portal.servlet.filters.lockout.LockoutFilter.processFilter(LockoutFilter.java:58)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)
           [exec]     	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)
           [exec]     	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:248)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)
           [exec]     	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
           [exec]     	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
           [exec]     	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
           [exec]     	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389)
           [exec]     	at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
           [exec]     	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:175)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:175)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)
           [exec]     	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:104)
           [exec]     	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
           [exec]     	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
           [exec]     	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
           [exec]     	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
           [exec]     	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
           [exec]     	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
           [exec]     	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
           [exec]     	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
           [exec]     	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346)
           [exec]     	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
           [exec]     	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
           [exec]     	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:887)
           [exec]     	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1684)
           [exec]     	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
           [exec]     	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
           [exec]     	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
           [exec]     	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
           [exec]     	at java.lang.Thread.run(Thread.java:745)
           [exec] 
           [exec]     	at org.junit.Assert.fail(Assert.java:89)
           [exec]     	at com.liferay.portal.test.rule.LogAssertionTestRule.endAssert(LogAssertionTestRule.java:129)
           [exec]     	at com.liferay.portal.test.rule.LogAssertionTestRule.afterClass(LogAssertionTestRule.java:186)
           [exec]     	at com.liferay.portal.test.rule.LogAssertionTestRule.afterMethod(LogAssertionTestRule.java:193)
           [exec]     	at com.liferay.portal.test.rule.LogAssertionTestRule.afterMethod(LogAssertionTestRule.java:50)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:106)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
           [exec]     	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
           [exec]     	at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$1.evaluate(TestExecutorRunnable.java:237)
           [exec]     	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
           [exec]     	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
           [exec]     	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
           [exec]     	at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable._execute(TestExecutorRunnable.java:316)
           [exec]     	at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable.run(TestExecutorRunnable.java:95)
           [exec]     	at java.lang.Thread.run(Thread.java:745)
       

      Unknown how long this issue has been in the code, the test was previously reporting a false positive due to a bug in the test infrastructure (fixed in LPS-128599).

        Attachments

          Activity

            People

            Assignee:
            brian.chan Brian Chan
            Reporter:
            victor.ware Victor Ware
            Participants of an Issue:
            Recent user:
            Rafaela Nascimento
            Engineering Assignee:
            Marta Medio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              6 weeks, 3 days ago

                Packages

                Version Package
                7.4.1 CE GA2
                Master