{"record":{"id":"cfba1ce166519039","repo":"languagetool-org/languagetool","slug":"could-not-start-languagetool-https-server-on-por","errorCode":null,"errorMessage":"Could not start LanguageTool HTTPS server on , port ","messagePattern":"Could not start LanguageTool HTTPS server on , port ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"languagetool-server/src/main/java/org/languagetool/server/HTTPSServer.java","lineNumber":149,"sourceCode":"      System.out.println(\"                 'password' - the keystore's password (deprecated, use a reverse proxy to handle SSL)\");\n      printCommonConfigFileOptions();\n      printCommonOptions();\n      System.exit(1);\n    }\n    try {\n      HTTPSServerConfig config = new HTTPSServerConfig(args);\n      try {\n        checkForNonRootUser();\n        HTTPSServer server;\n        if (config.isPublicAccess()) {\n          System.out.println(\"WARNING: running in public mode, LanguageTool API can be accessed without restrictions!\");\n          server = new HTTPSServer(config, false, null, null);\n        } else {\n          server = new HTTPSServer(config, false, DEFAULT_HOST, DEFAULT_ALLOWED_IPS);\n        }\n        server.run();\n      } catch (Exception e) {\n        throw new RuntimeException(\"Could not start LanguageTool HTTPS server on \" + HTTPServerConfig.DEFAULT_HOST + \", port \" + config.getPort(), e);\n      }\n    } catch (IllegalConfigurationException e) {\n      System.out.println(e.getMessage());\n      System.out.println(\"Note: this is the HTTPS server - if you want to use plain HTTP instead, please see https://dev.languagetool.org/http-server\");\n      System.exit(1);\n    }\n  }\n\n  @Override\n  protected String getProtocol() {\n    return \"https\";\n  }\n\n}\n","sourceCodeStart":131,"sourceCodeEnd":164,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/HTTPSServer.java#L131-L164","documentation":"HTTPSServer.main wraps server construction/startup so any Exception while starting the HTTPS server becomes RuntimeException('Could not start LanguageTool HTTPS server on <host>, port <port>'). It is the top-level startup failure for command-line HTTPS server runs.","triggerScenarios":"Running the HTTPSServer main class where new HTTPSServer(...) or server.run() throws — most commonly a bound port (BindException) or SSL context failure (see errors 313-315).","commonSituations":"Command-line startup on a busy port; bad --config property file values (keystore/password); missing config leading to IllegalConfigurationException (handled separately with a note).","solutions":["Read the wrapped cause of this RuntimeException to find the underlying failure (usually port-in-use or SSL problem).","Free the port or change the configured port.","Fix keystore path/format/password (see error 315 steps).","Check the --config property file for typos; see https://dev.languagetool.org/http-server for correct configuration."],"exampleFix":"// before\nport = 8081   // already in use\n// after\nport = 8083   # free port, or stop the conflicting process first","handlingStrategy":"try-catch","validationCode":"// preflight: config file present, port free\nif (!new File(configPath).canRead()) throw new IllegalStateException(\"missing config \" + configPath);\ntry (ServerSocket s = new ServerSocket(port)) { /* free */ }","typeGuard":null,"tryCatchPattern":"try {\n  HTTPSServer.main(args);\n} catch (RuntimeException e) {\n  log.error(\"LT HTTPS startup failed: {}\", e.getCause(), e);\n  System.exit(1);\n}","preventionTips":["Use absolute paths for --config and keystore in startup scripts","Run a preflight script checking config readability and port availability","Keep the property file under version control with correct values per environment"],"tags":["server-startup","https","port-binding"],"backgroundTag":"server-startup-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"}