Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3262

Cannot run fix mailboxes inconsistencies task

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Some user reported that when trying to run the fixing mailboxes inconsistencies task https://github.com/apache/james-project/blob/master/src/site/markdown/server/manage-webadmin.md#fixing-mailboxes-inconsistencies

       

      They got this as a response:

      {
        "statusCode": 500,
        "type": "ServerError",
        "message": "WebAdmin encountered an unexpected internal error",
        "details": null
      }
      

      A first investigation reveals that they might have forgotten to add the `I-KNOW-WHAT-I-M-DOING` header, leading to a 500 response. However, we should not return 500 in this case. Copy of the stacktrace to support this theory:

      james-68b98ddd79-dp2mh james 01:18:56.382 [ERROR] s.h.m.GeneralError - 
      james-68b98ddd79-dp2mh james java.lang.NullPointerException: null
      james-68b98ddd79-dp2mh james 	at org.apache.james.webadmin.routes.SolveMailboxInconsistenciesRequestToTask.lambda$new$0(SolveMailboxInconsistenciesRequestToTask.java:39)
      james-68b98ddd79-dp2mh james 	at org.apache.james.webadmin.tasks.TaskFromRequestRegistry$TaskRegistration.fromRequest(TaskFromRequestRegistry.java:115)
      james-68b98ddd79-dp2mh james 	at org.apache.james.webadmin.tasks.TaskFromRequestRegistry.lambda$fromRequest$0(TaskFromRequestRegistry.java:141)
      james-68b98ddd79-dp2mh james 	at com.github.fge.lambdas.functions.FunctionChainer.lambda$sneakyThrow$49(FunctionChainer.java:74)
      james-68b98ddd79-dp2mh james 	at java.base/java.util.Optional.map(Unknown Source)
      james-68b98ddd79-dp2mh james 	at org.apache.james.webadmin.tasks.TaskFromRequestRegistry.fromRequest(TaskFromRequestRegistry.java:141)
      james-68b98ddd79-dp2mh james 	at org.apache.james.webadmin.tasks.TaskFromRequest$TaskRoute.handle(TaskFromRequest.java:46)
      james-68b98ddd79-dp2mh james 	at org.apache.james.webadmin.tasks.TaskFromRequest$TaskRoute.handle(TaskFromRequest.java:35)
      james-68b98ddd79-dp2mh james 	at spark.ResponseTransformerRouteImpl$1.handle(ResponseTransformerRouteImpl.java:47)
      james-68b98ddd79-dp2mh james 	at spark.http.matching.Routes.execute(Routes.java:61)
      james-68b98ddd79-dp2mh james 	at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:134)
      james-68b98ddd79-dp2mh james 	at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1671)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.server.Server.handle(Server.java:505)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
      james-68b98ddd79-dp2mh james 	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
      james-68b98ddd79-dp2mh james 	at java.base/java.lang.Thread.run(Unknown Source)
      

      DoD :

      • Reproduce the error with a unit test
      • fix it: upon missing header we should return 400
      • eventually rework the webadmin documentation to make it more clear that this header is needed

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rcordier René Cordier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: