{"record":{"id":"138e7bb48bee596f","repo":"languagetool-org/languagetool","slug":"could-not-load-properties-from","errorCode":null,"errorMessage":"Could not load properties from ''","messagePattern":"Could not load properties from ''","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/HTTPSServerConfig.java","lineNumber":93,"sourceCode":"    super(args);\n    File config = null;\n    for (int i = 0; i < args.length; i++) {\n      if (\"--config\".equals(args[i])) {\n        config = new File(args[++i]);\n      }\n    }\n    if (config == null) {\n      throw new IllegalConfigurationException(\"Parameter --config must be set and point to a property file\");\n    }\n    try {\n      Properties props = new Properties();\n      try (FileInputStream fis = new FileInputStream(config)) {\n        props.load(fis);\n        keystore = new File(getProperty(props, \"keystore\", config));\n        keyStorePassword = getProperty(props, \"password\", config);\n      }\n    } catch (IOException e) {\n      throw new RuntimeException(\"Could not load properties from '\" + config + \"'\", e);\n    }\n  }\n\n  File getKeystore() {\n    return keystore;\n  }\n\n  String getKeyStorePassword() {\n    return keyStorePassword;\n  }\n\n}\n","sourceCodeStart":75,"sourceCodeEnd":106,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/HTTPSServerConfig.java#L75-L106","documentation":"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>'\").","triggerScenarios":"The --config path does not exist; the file is a directory; the process lacks read permission; an IO error occurs while streaming the file.","commonSituations":"Relative path resolved from a different working directory (systemd WorkingDirectory, Docker WORKDIR); config file deleted/moved after a deploy; wrong container mount; permission changes.","solutions":["Verify the path exists and is a readable file: ls -l <path> (as the server user).","Use an absolute path for --config to avoid working-directory surprises.","Fix file permissions (chmod/chown) or correct the container volume mount.","Ensure the JVM's working directory is where the relative path is expected."],"exampleFix":"// before\n--config server.properties   // started from /, file actually in /opt/lt/\n// after\n--config /opt/lt/server.properties","handlingStrategy":"try-catch","validationCode":"// before launch\nFile cfg = new File(configPath);\nif (!cfg.isFile() || !cfg.canRead()) throw new IllegalStateException(\"unreadable config: \" + cfg.getAbsolutePath());","typeGuard":null,"tryCatchPattern":"try {\n  HTTPSServer.main(args);\n} catch (RuntimeException e) {\n  if (e.getMessage().startsWith(\"Could not load properties\")) {\n    log.error(\"Config file unreadable at declared path — check cwd, mounts, permissions\", e.getCause());\n  }\n}","preventionTips":["Use absolute config paths to avoid working-directory mismatches","Check systemd WorkingDirectory / Docker WORKDIR / volume mounts","Verify read permissions for the service user after deploys"],"tags":["io","file-not-found","configuration"],"backgroundTag":"file-read-failed","analyzedSha":"2e990059ce67d5e2a0f7f7ca5d31160c6709df4b","analyzedAt":"2026-09-06T09:20:17.015Z","contentChangedAt":"2026-09-06T09:20:17.015Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}