{"record":{"id":"a294c9ae91cc6f2c","repo":"apache/hadoop","slug":"failed-to-initialize-hostrestrictingauthorizationf","errorCode":null,"errorMessage":"Failed to initialize HostRestrictingAuthorizationFilter.","messagePattern":"Failed to initialize HostRestrictingAuthorizationFilter\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/HostRestrictingAuthorizationFilterHandler.java","lineNumber":131,"sourceCode":"  initializeState(Configuration conf) {\n    String confName = HostRestrictingAuthorizationFilter.HDFS_CONFIG_PREFIX +\n        HostRestrictingAuthorizationFilter.RESTRICTION_CONFIG;\n    String confValue = conf.get(confName);\n    // simply pass a blank value if we do not have one set\n    confValue = (confValue == null ? \"\" : confValue);\n\n    Map<String, String> confMap =\n        ImmutableMap.of(HostRestrictingAuthorizationFilter.RESTRICTION_CONFIG\n            , confValue);\n    FilterConfig fc =\n        new DatanodeHttpServer.MapBasedFilterConfig(\n            HostRestrictingAuthorizationFilter.class.getName(), confMap);\n    HostRestrictingAuthorizationFilter hostRestrictingAuthorizationFilter =\n        new HostRestrictingAuthorizationFilter();\n    try {\n      hostRestrictingAuthorizationFilter.init(fc);\n    } catch (ServletException e) {\n      throw new IllegalStateException(\n          \"Failed to initialize HostRestrictingAuthorizationFilter.\", e);\n    }\n    return hostRestrictingAuthorizationFilter;\n  }\n\n  /*\n   * Finish handling this pipeline by writing a response with the\n   * \"Connection: close\" header, flushing, and scheduling a close of the\n   * connection.\n   *\n   * @param ctx context to receive the response\n   * @param resp response to send\n   */\n  private static void sendResponseAndClose(ChannelHandlerContext ctx,\n      DefaultHttpResponse resp) {\n    resp.headers().set(CONNECTION, CLOSE);\n    ctx.writeAndFlush(resp).addListener(ChannelFutureListener.CLOSE);\n  }","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/web/HostRestrictingAuthorizationFilterHandler.java#L113-L149","documentation":"Error \"Failed to initialize HostRestrictingAuthorizationFilter.\" thrown in apache/hadoop.","triggerScenarios":"DataNode HTTP server startup when the HostRestrictingAuthorizationFilter cannot be initialized, e.g. invalid configuration.","commonSituations":"See trigger scenarios.","solutions":["Verify the HostRestrictingAuthorizationFilter configuration (allowed hosts/subnets settings) in hdfs-site.xml.","Check the DataNode web log for the initialization exception cause and fix the malformed ACL/network entries."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}