{"record":{"id":"5145e86d3a42bb43","repo":"apache/hadoop","slug":"s06","errorCode":"S06","errorMessage":"Could not load file [{0}], {1}","messagePattern":"Could not load file \\[(.+?)\\], (.+?)","errorType":"error_code","errorClass":"ServerException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java","lineNumber":477,"sourceCode":"    }\n\n    if (config == null) {\n      Configuration siteConf;\n      File siteFile = new File(file, name + \"-site.xml\");\n      if (!siteFile.exists()) {\n        log.warn(\"Site configuration file [{}] not found in config directory\", siteFile);\n        siteConf = new Configuration(false);\n      } else {\n        if (!siteFile.isFile()) {\n          throw new ServerException(ServerException.ERROR.S05, siteFile.getAbsolutePath());\n        }\n        try {\n          log.debug(\"Loading site configuration from [{}]\", siteFile);\n          inputStream = Files.newInputStream(siteFile.toPath());\n          siteConf = new Configuration(false);\n          ConfigurationUtils.load(siteConf, inputStream);\n        } catch (IOException ex) {\n          throw new ServerException(ServerException.ERROR.S06, siteFile, ex.getMessage(), ex);\n        }\n      }\n\n      config = new Configuration(false);\n      ConfigurationUtils.copy(siteConf, config);\n    }\n\n    ConfigurationUtils.injectDefaults(defaultConf, config);\n    ConfigRedactor redactor = new ConfigRedactor(config);\n    for (String name : System.getProperties().stringPropertyNames()) {\n      String value = System.getProperty(name);\n      if (name.startsWith(getPrefix() + \".\")) {\n        config.set(name, value);\n        String redacted = redactor.redact(name, value);\n        log.info(\"System property sets  {}: {}\", name, redacted);\n      }\n    }\n","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java#L459-L495","documentation":"After confirming httpfs-site.xml is a regular file, Server.initConfig() opens and parses it; an IOException during open/read/parse is wrapped as ServerException S06('Could not load file [<file>], <cause>'). Common causes: XML not well-formed, unreadable permissions, or read errors on the underlying storage.","triggerScenarios":"Editing httpfs-site.xml and leaving an unclosed tag or stray '&' ; file owned by root with no read for the httpfs user; NFS stale handle or disk fault when reading; concurrent edit that truncated the file mid-read.","commonSituations":"Manual edits without validation before restart; automated config pushes that race with the daemon start; permission drift after security hardening; XML containing raw '<' in values (e.g. passwords).","solutions":["Validate syntax: xmllint --noout /etc/hadoop/httpfs/conf/httpfs-site.xml and fix reported line/column.","Check permissions: the httpfs run user must read the file (chown/chmod as needed).","Escape special characters (& < >) in property values or wrap them in CDATA.","Keep a pre-restart config check (xmllint) in your deployment pipeline so bad XML never reaches the daemon."],"exampleFix":"<!-- before: invalid XML -->\n<property><name>httpfs.admin.group</name><value>a&b</value></property>\n\n<!-- after -->\n<property><name>httpfs.admin.group</value>a&amp;b</value></property>","handlingStrategy":"validation","validationCode":"# pre-start: site XML must be well-formed and readable\nSITE=\"${HTTPFS_CONFIG}/httpfs-site.xml\"\nxmllint --noout \"$SITE\" || { echo 'FATAL: malformed XML'; exit 1; }\nsudo -u httpfs test -r \"$SITE\" || { echo 'FATAL: not readable by httpfs'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run xmllint on httpfs-site.xml in CI and in pre-start hooks.","Escape XML specials (&, <) in property values.","Use atomic writes (write temp + rename) when pushing config so the daemon never reads a half-written file."],"tags":["httpfs","server-startup","xml-config","configuration","file-permissions"],"backgroundTag":"config-load-failure","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}