{"record":{"id":"26cdff37bff4959c","repo":"apache/hadoop","slug":"s05","errorCode":"S05","errorMessage":"[{0}] is not a file","messagePattern":"\\[(.+?)\\] is not a 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":469,"sourceCode":"      defaultConf = new Configuration(false);\n    } else {\n      try {\n        defaultConf = new Configuration(false);\n        ConfigurationUtils.load(defaultConf, inputStream);\n      } catch (Exception ex) {\n        throw new ServerException(ServerException.ERROR.S03, defaultConfig, ex.getMessage(), ex);\n      }\n    }\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()) {","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/lib/server/Server.java#L451-L487","documentation":"While loading site configuration, Server.initConfig() accepts a missing httpfs-site.xml (warn only) but if the path exists yet is not a regular file — typically a directory — it throws ServerException S05('[<path>] is not a file') and aborts startup.","triggerScenarios":"/etc/hadoop/conf/httpfs-site.xml created as a directory (e.g. by mkdir -p gone wrong or a mount point placeholder); a bind-mount that mounted a directory over the expected file path; tooling that creates empty directory stubs for config paths.","commonSituations":"Config-management systems (Puppet/Chef/Ansible) managing the path as a directory resource; Kubernetes configMap volume mounts that expose a directory where a single file was expected; operators confusing the config DIR and the site FILE path.","solutions":["Check ls -ld on the exact path from the message; if it is a directory, remove it and install the XML file (or point httpfs.config.dir at the right directory).","For configMap-style mounts, mount the key as a subPath/file so the final path is a regular file.","Re-run startup and confirm it reaches init of services."],"exampleFix":"# before\n$ ls -ld /etc/hadoop/httpfs/conf/httpfs-site.xml\ndrwxr-xr-x 2 root root ... /etc/hadoop/httpfs/conf/httpfs-site.xml  # directory!\n\n# after\n$ rmdir /etc/hadoop/httpfs/conf/httpfs-site.xml\n$ cp httpfs-site.xml /etc/hadoop/httpfs/conf/httpfs-site.xml","handlingStrategy":"validation","validationCode":"# pre-start: site file must be a regular file if present\nSITE=\"${HTTPFS_CONFIG}/httpfs-site.xml\"\nif [ -e \"$SITE\" ] && [ ! -f \"$SITE\" ]; then\n  echo \"FATAL: $SITE exists but is not a regular file\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mount configMap keys as files (subPath), not as directories over the file path.","Lint config trees after every config-management run: find path -type d where a file is expected.","Keep the config dir vs config file distinction explicit in scripts."],"tags":["httpfs","server-startup","config-file","path-validation"],"backgroundTag":"invalid-config-path","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}