{"record":{"id":"646d2a5655938116","repo":"languagetool-org/languagetool","slug":"fasttext-binary-path-not-valid-file-doesn-t-exist","errorCode":null,"errorMessage":"Fasttext binary path not valid (file doesn't exist, is a directory or not executable): ","messagePattern":"Fasttext binary path not valid \\(file doesn't exist, is a directory or not executable\\): ","errorType":"console","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java","lineNumber":572,"sourceCode":"    }\n  }\n\n  public void setLanguageModelDirectory(String langModelDir) {\n    SuggestionsOrdererConfig.setNgramsPath(langModelDir);\n    languageModelDir = new File(langModelDir);\n    if (!languageModelDir.exists() || !languageModelDir.isDirectory()) {\n      throw new RuntimeException(\"LanguageModel directory not found or is not a directory: \" + languageModelDir);\n    }\n  }\n\n  void setFasttextPaths(String fasttextModelPath, String fasttextBinaryPath) {\n    fasttextModel = new File(fasttextModelPath);\n    fasttextBinary = new File(fasttextBinaryPath);\n    if (!fasttextModel.exists() || fasttextModel.isDirectory()) {\n      throw new RuntimeException(\"Fasttext model path not valid (file doesn't exist or is a directory): \" + fasttextModelPath);\n    }\n    if (!fasttextBinary.exists() || fasttextBinary.isDirectory() || !fasttextBinary.canExecute()) {\n      throw new RuntimeException(\"Fasttext binary path not valid (file doesn't exist, is a directory or not executable): \" + fasttextBinaryPath);\n    }\n  }\n\n  /*\n   * @param verbose if true, the text to be checked will be displayed in case of exceptions\n   */\n  public boolean isVerbose() {\n    return verbose;\n  }\n\n  public boolean isPublicAccess() {\n    return publicAccess;\n  }\n\n  public int getPort() {\n    return port;\n  }\n","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/languagetool-org/languagetool/blob/2e990059ce67d5e2a0f7f7ca5d31160c6709df4b/languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java#L554-L590","documentation":"Configuration validation in setFasttextPaths: the fasttext binary file does not exist, is a directory, or is not executable, so fasttext predictions cannot run.","triggerScenarios":"Calling setFasttextPaths(modelPath, binaryPath) (or the --fasttextBinary server option) where the binary is absent, points to a directory, or lacks the execute permission bit.","commonSituations":"fasttext not compiled/installed, binary downloaded but `chmod +x` never applied, path pointing to source directory instead of the compiled executable, or running under a user without execute permission.","solutions":["Run `chmod +x <binaryPath>` to make the fasttext binary executable","Build or install fasttext and point the option at the compiled executable file","Verify with `ls -l` and test execution directly: `<binaryPath> --help`"],"exampleFix":"// before\nchmod 644 /opt/fasttext/fasttext\n// after\nchmod +x /opt/fasttext/fasttext","handlingStrategy":"validation","validationCode":"File bin = new File(fasttextBinaryPath);\nif (!bin.isFile() || !bin.canExecute())\n  throw new IllegalStateException(\"fasttext binary not executable: \" + fasttextBinaryPath);","typeGuard":null,"tryCatchPattern":"try {\n  config.setFasttextPaths(modelPath, binaryPath);\n} catch (RuntimeException e) {\n  LOG.error(\"fasttext binary invalid: {}\", e.getMessage());\n}","preventionTips":["chmod +x the fasttext binary as part of provisioning","Compile fasttext during image build, not at runtime","Smoke-test the binary with `fasttext --help` in the startup script"],"tags":["configuration","filesystem","permissions","fasttext"],"backgroundTag":"file-not-found","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"}