apache/hadoop · error · ServiceLaunchException
44
44
Error message
--conf: configuration file not found: %s
What it means
After argument parsing succeeds, ServiceLauncher.verifyConfigurationFilesExist() walks every file passed via -conf/--conf and requires File.exists(); a missing file aborts launch with ServiceLaunchException exit code 44 (EXIT_NOT_FOUND) and the absolute path. This is a deliberate fail-fast so a service never starts with silently dropped configuration.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/service/launcher/ServiceLauncher.java:998
String[] argArray) throws IOException {
return new MinimalGenericOptionsParser(conf, commandOptions, argArray);
}
/**
* Verify that all the specified filenames exist.
* @param filenames a list of files
* @throws ServiceLaunchException if a file is not found
*/
protected void verifyConfigurationFilesExist(String[] filenames) {
if (filenames == null) {
return;
}
for (String filename : filenames) {
File file = new File(filename);
LOG.debug("Conf file {}", file.getAbsolutePath());
if (!file.exists()) {
// no configuration file
throw new ServiceLaunchException(EXIT_NOT_FOUND,
ARG_CONF_PREFIXED + ": configuration file not found: %s",
file.getAbsolutePath());
}
}
}
/**
* @return Build a log message for starting up and shutting down.
* @param classname the class of the server
* @param args arguments
*/
protected static String startupShutdownMessage(String classname,
List<String> args) {
final String hostname = NetUtils.getHostname();
return StringUtils.createStartupShutdownMessage(classname, hostname,
args.toArray(new String[args.size()]));
}View on GitHub (pinned to 2add963021)
Solutions
- Check the absolute path printed in the message with `ls` from the same working directory
- Use an absolute path for --conf instead of a relative one
- Confirm the file was actually deployed/copied to this node
- Verify the launching user can traverse (execute bit) every parent directory
Example fix
# before hadoop $SERVICE --conf conf/service-site.xml # after hadoop $SERVICE --conf /etc/hadoop/conf/service-site.xml
Defensive patterns
Strategy: validation
Validate before calling
List<String> confFiles = Arrays.asList("/etc/hadoop/conf/service-site.xml");
for (String f : confFiles) {
if (!java.nio.file.Files.exists(java.nio.file.Paths.get(f))) {
throw new IllegalStateException("missing --conf file: " + f);
}
} Try / catch
catch (ServiceLaunchException e) {
if (e.getExitCode() == ServiceLaunchException.EXIT_NOT_FOUND) {
// the message carries the absolute path that was missing
log.error("config file absent on this node: {}", e.getMessage());
}
} Prevention
- Use absolute paths for --conf in cron/Oozie/service definitions
- Add a deploy-time check that every configured conf file exists on each node
- Ensure the launching user can traverse parent directories of the conf path
When it happens
Trigger: `hadoop ... --conf ./conf/service-site.xml` run from a working directory where the relative path does not resolve; a typo'd filename; the config file never deployed to that node; a parent directory lacking execute permission so the path cannot be resolved.
Common situations: Relative --conf paths in cron/Oozie/shell launches where the working directory differs; files copied to some nodes but not all; directory permissions changed during hardening.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
- EXIT_COMMAND_ARGUMENT_ERROR(40)
- 40
- Specified work directory does not exists: %s
- Specified configuration does not exists: %s
- key + ": No such file or directory."
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/3f9356c457a07cd0.
Report an issue: GitHub.