languagetool-org/languagetool · error · RuntimeException

Could not load properties from ''

Error message

Could not load properties from ''

What it means

After --config is parsed, HTTPSServerConfig opens the properties file with FileInputStream and loads keystore settings; an IOException during load (missing file, unreadable, IO error) is rethrown as RuntimeException("Could not load properties from '<path>'").

Source

Thrown at languagetool-server/src/main/java/org/languagetool/server/HTTPSServerConfig.java:93

    super(args);
    File config = null;
    for (int i = 0; i < args.length; i++) {
      if ("--config".equals(args[i])) {
        config = new File(args[++i]);
      }
    }
    if (config == null) {
      throw new IllegalConfigurationException("Parameter --config must be set and point to a property file");
    }
    try {
      Properties props = new Properties();
      try (FileInputStream fis = new FileInputStream(config)) {
        props.load(fis);
        keystore = new File(getProperty(props, "keystore", config));
        keyStorePassword = getProperty(props, "password", config);
      }
    } catch (IOException e) {
      throw new RuntimeException("Could not load properties from '" + config + "'", e);
    }
  }

  File getKeystore() {
    return keystore;
  }

  String getKeyStorePassword() {
    return keyStorePassword;
  }

}

View on GitHub (pinned to 2e990059ce)

Solutions

  1. Verify the path exists and is a readable file: ls -l <path> (as the server user).
  2. Use an absolute path for --config to avoid working-directory surprises.
  3. Fix file permissions (chmod/chown) or correct the container volume mount.
  4. Ensure the JVM's working directory is where the relative path is expected.

Example fix

// before
--config server.properties   // started from /, file actually in /opt/lt/
// after
--config /opt/lt/server.properties
Defensive patterns

Strategy: try-catch

Validate before calling

// before launch
File cfg = new File(configPath);
if (!cfg.isFile() || !cfg.canRead()) throw new IllegalStateException("unreadable config: " + cfg.getAbsolutePath());

Try / catch

try {
  HTTPSServer.main(args);
} catch (RuntimeException e) {
  if (e.getMessage().startsWith("Could not load properties")) {
    log.error("Config file unreadable at declared path — check cwd, mounts, permissions", e.getCause());
  }
}

Prevention

When it happens

Trigger: The --config path does not exist; the file is a directory; the process lacks read permission; an IO error occurs while streaming the file.

Common situations: Relative path resolved from a different working directory (systemd WorkingDirectory, Docker WORKDIR); config file deleted/moved after a deploy; wrong container mount; permission changes.

Understand the failure class

Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.

Related errors


AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06). Data as JSON: /api/errors/138e7bb48bee596f. Report an issue: GitHub.