{"record":{"id":"869e6874629b20b6","repo":"apache/hadoop","slug":"problem-in-starting-http-server-server-handlers-f","errorCode":null,"errorMessage":"Problem in starting http server. Server handlers failed","messagePattern":"Problem in starting http server\\. Server handlers failed","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java","lineNumber":1475,"sourceCode":"            acceptorThreads += connector.getAcceptors();\n            selectorThreads += connector.getSelectorManager().getSelectorCount();\n          }\n          metrics = HttpServer2Metrics.create(statsHandler, port,\n              (QueuedThreadPool) webServer.getThreadPool(),\n              acceptorThreads, selectorThreads);\n        }\n      } catch (IOException ex) {\n        LOG.info(\"HttpServer.start() threw a non Bind IOException\", ex);\n        throw ex;\n      } catch (MultiException ex) {\n        LOG.info(\"HttpServer.start() threw a MultiException\", ex);\n        throw ex;\n      }\n      // Make sure there is no handler failures.\n      Handler[] hs = webServer.getHandlers();\n      for (Handler handler : hs) {\n        if (handler.isFailed()) {\n          throw new IOException(\n              \"Problem in starting http server. Server handlers failed\");\n        }\n      }\n      // Make sure there are no errors initializing the context.\n      Throwable unavailableException = webAppContext.getUnavailableException();\n      if (unavailableException != null) {\n        // Have to stop the webserver, or else its non-daemon threads\n        // will hang forever.\n        webServer.stop();\n        throw new IOException(\"Unable to initialize WebAppContext\",\n            unavailableException);\n      }\n    } catch (IOException e) {\n      throw e;\n    } catch (InterruptedException e) {\n      throw (IOException) new InterruptedIOException(\n          \"Interrupted while starting HTTP server\").initCause(e);\n    } catch (Exception e) {","sourceCodeStart":1457,"sourceCodeEnd":1493,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java#L1457-L1493","documentation":"After Jetty's webServer.start() returns, HttpServer2 iterates all registered Handlers and fails the startup with IOException if any handler reports isFailed(). Jetty marks a handler failed when its doStart() threw; the original exception appears earlier in the log under Jetty's own warning lines, so this IOException is the late, aggregate signal.","triggerScenarios":"A servlet filter initializer or context handler throwing during doStart: bad hadoop.http.filter.configuration classes, authentication filter misconfiguration (spnego/keytab problems at filter init), or a duplicate context path colliding with another handler.","commonSituations":"Enabling Kerberos SPNEGO for the web UI with a missing keytab/principal; deploying custom filters whose init() fails; port/context conflicts in embedded use.","solutions":["Scroll up in the log to the first WARN/ERROR from org.eclipse.jetty around startup - it carries the root cause (this IOException has no cause chain)","Verify filter configuration (hadoop.http.filter.configuration, hadoop.http.authentication.*) and keytab readability","Check for duplicate context handlers/servlet names added via the builder","Fix the underlying handler init error and restart the daemon"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  httpServer.start();\n} catch (IOException e) {\n  if (\"Problem in starting http server. Server handlers failed\".equals(e.getMessage())) {\n    // no cause chain: root cause is in earlier Jetty WARN/ERROR lines - grep the startup log\n  }\n}","preventionTips":["Always capture full startup logs; the handler root cause precedes this IOException","Test filter classes and auth configurations in a staging daemon before rollout","Validate keytabs/principals for SPNEGO filters before enabling them on web UIs"],"tags":["hadoop","http-server","jetty","startup","filter"],"backgroundTag":"jetty-handler-startup-failure","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}