{"record":{"id":"ae6dd6abcaa8aef0","repo":"oraios/serena","slug":"fsautocomplete-executable-not-found-at-fsautocomp","errorCode":null,"errorMessage":"FsAutoComplete executable not found at {fsautocomplete_path}, something went wrong with the installation.","messagePattern":"FsAutoComplete executable not found at (.+?), something went wrong with the installation\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/fsharp_language_server.py","lineNumber":182,"sourceCode":"            # Ensure the directory exists\n            os.makedirs(fsharp_ls_dir, exist_ok=True)\n\n            # Install FsAutoComplete using dotnet tool install\n            try:\n                result = subprocess_run(\n                    [dotnet_exe, \"tool\", \"install\", \"--tool-path\", fsharp_ls_dir, \"fsautocomplete\", \"--version\", fsautocomplete_version],\n                    cwd=fsharp_ls_dir,\n                    capture_output=True,\n                    text=True,\n                    check=True,\n                )\n                log.info(\"FsAutoComplete installed successfully\")\n                log.debug(f\"Installation output: {result.stdout}\")\n            except subprocess.CalledProcessError as e:\n                log.error(f\"Failed to install FsAutoComplete: {e.stderr}\")\n                raise RuntimeError(f\"Failed to install FsAutoComplete: {e.stderr}\")\n\n        if not os.path.exists(fsautocomplete_path):\n            raise FileNotFoundError(\n                f\"FsAutoComplete executable not found at {fsautocomplete_path}, something went wrong with the installation.\"\n            )\n\n        # FsAutoComplete uses --lsp flag for LSP mode\n        return f\"{fsautocomplete_path} --adaptive-lsp-server-enabled --project-graph-enabled --use-fcs-transparent-compiler\"\n\n    def _create_base_initialize_params(self) -> dict:\n        \"\"\"\n        Returns the initialize params for the F# Language Server.\n        \"\"\"\n        initialize_params = {\n            \"capabilities\": {\n                \"workspace\": {\n                    \"applyEdit\": True,\n                    \"workspaceEdit\": {\"documentChanges\": True},\n                    \"didChangeConfiguration\": {\"dynamicRegistration\": True},\n                    \"didChangeWatchedFiles\": {\"dynamicRegistration\": True},","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/fsharp_language_server.py#L164-L200","documentation":"After the FsAutoComplete install step, Serena verifies the fsautocomplete executable exists at its expected path. If it is still missing even when the install command didn't fail, _setup_runtime_dependencies raises FileNotFoundError, meaning the install produced no usable binary.","triggerScenarios":"Starting the F# language server when os.path.exists(fsautocomplete_path) is false after setup — the dotnet tool installed to a directory not on PATH/expected location, ~/.dotnet/tools missing from PATH, or a no-op install.","commonSituations":"dotnet tool installed globally but ~/.dotnet/tools not on PATH so the wrapper script isn't found; partial disk/permission issues; installing as a different user than the one running Serena.","solutions":["Run: dotnet tool install --global fsautocomplete (or update) and ensure it reports success","Add ~/.dotnet/tools to PATH (export PATH=\"$PATH:$HOME/.dotnet/tools\") for the process running Serena","Verify with: which fsautocomplete, then restart Serena","If installed under a different user/home, install as the same user Serena runs as"],"exampleFix":"// before\n$ which fsautocomplete   # not found (tools dir not on PATH)\n// after\n$ export PATH=\"$PATH:$HOME/.dotnet/tools\"\n$ which fsautocomplete\n/home/user/.dotnet/tools/fsautocomplete\n","handlingStrategy":"validation","validationCode":"import os, shutil\ndef fsautocomplete_available() -> bool:\n    home = os.path.expanduser(\"~/.dotnet/tools\")\n    return shutil.which(\"fsautocomplete\") is not None or os.path.exists(\n        os.path.join(home, \"fsautocomplete\")\n    )","typeGuard":"def executable_exists(path: str) -> bool:\n    import os\n    return os.path.isfile(path) and os.access(path, os.X_OK)","tryCatchPattern":"try:\n    server = LanguageServer.create(LanguageServerId.FSHARP, ...)\nexcept FileNotFoundError as e:\n    if \"FsAutoComplete\" in str(e):\n        logger.error(\"Add ~/.dotnet/tools to PATH and run `dotnet tool install --global fsautocomplete`\")","preventionTips":["Add ~/.dotnet/tools to PATH in shell profiles and CI images","Install dotnet tools as the same user that runs Serena","Verify `which fsautocomplete` in bootstrap checks","Confirm install output says 'was successfully installed' before proceeding"],"tags":["fsharp","dotnet","file-not-found","installation-failed"],"backgroundTag":"managed-dependency-install-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}