Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21792

The XWiki-User header is set for the guest user, leading to an error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 15.10.5
    • 15.10
    • REST
    • Unknown
    • N/A
    • N/A

    Description

      Jetty 10 was lenient but Jetty 12 has changed and is now logging the following:

      Jan 11, 2024 4:21:20 PM org.restlet.engine.adapter.HttpServerHelper handle
      WARNING: Error while handling an HTTP server call
      java.lang.IllegalArgumentException: null value
      	at org.eclipse.jetty.http.HttpFields$Mutable.add(HttpFields.java:901)
      	at org.eclipse.jetty.ee8.nested.Response.addHeader(Response.java:631)
      	at org.restlet.ext.servlet.internal.ServletCall.sendResponse(ServletCall.java:383)
      	at org.restlet.engine.adapter.ServerAdapter.commit(ServerAdapter.java:208)
      	at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:144)
      	at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
      	at org.eclipse.jetty.ee8.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1151)
      	at org.eclipse.jetty.ee8.servlet.ServletHolder.handle(ServletHolder.java:640)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1374)
      	at com.xpn.xwiki.web.XWikiContextInitializationFilter.doFilter(XWikiContextInitializationFilter.java:82)
      	at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)
      	at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
      	at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)
      	at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
      	at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)
      	at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
      	at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)
      	at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
      	at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:177)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)
      	at org.eclipse.jetty.ee8.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:175)
      	at org.eclipse.jetty.ee8.servlet.FilterHolder.doFilter(FilterHolder.java:171)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1348)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler.doHandle(ServletHandler.java:454)
      	at org.eclipse.jetty.ee8.nested.ScopedHandler.handle(ScopedHandler.java:119)
      	at org.eclipse.jetty.ee8.security.SecurityHandler.handle(SecurityHandler.java:499)
      	at org.eclipse.jetty.ee8.nested.HandlerWrapper.handle(HandlerWrapper.java:108)
      	at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:183)
      	at org.eclipse.jetty.ee8.nested.SessionHandler.doHandle(SessionHandler.java:404)
      	at org.eclipse.jetty.ee8.nested.ScopedHandler.nextHandle(ScopedHandler.java:181)
      	at org.eclipse.jetty.ee8.nested.ContextHandler.doHandle(ContextHandler.java:858)
      	at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:152)
      	at org.eclipse.jetty.ee8.servlet.ServletHandler.doScope(ServletHandler.java:423)
      	at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)
      	at org.eclipse.jetty.ee8.nested.SessionHandler.doScope(SessionHandler.java:399)
      	at org.eclipse.jetty.ee8.nested.ScopedHandler.nextScope(ScopedHandler.java:150)
      	at org.eclipse.jetty.ee8.nested.ContextHandler.doScope(ContextHandler.java:803)
      	at org.eclipse.jetty.ee8.nested.ScopedHandler.handle(ScopedHandler.java:117)
      	at org.eclipse.jetty.ee8.nested.ContextHandler.handle(ContextHandler.java:1401)
      	at org.eclipse.jetty.ee8.nested.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1293)
      	at org.eclipse.jetty.ee8.nested.HttpChannel.dispatch(HttpChannel.java:623)
      	at org.eclipse.jetty.ee8.nested.HttpChannel.handle(HttpChannel.java:455)
      	at org.eclipse.jetty.ee8.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler.handle(ContextHandler.java:2233)
      	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:761)
      	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:181)
      	at org.eclipse.jetty.server.Server.handle(Server.java:179)
      	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:594)
      	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:424)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
      	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:410)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:971)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1201)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1156)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      

      This is caused by https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/XWikiFilter.java#L103C13-L103C102

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: