{"record":{"id":"fcac1c0c5b8a2b83","repo":"oraios/serena","slug":"failed-to-install-fsautocomplete-e-stderr","errorCode":null,"errorMessage":"Failed to install FsAutoComplete: {e.stderr}","messagePattern":"Failed to install FsAutoComplete: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/fsharp_language_server.py","lineNumber":180,"sourceCode":"            log.info(f\"FsAutoComplete executable not found at {fsautocomplete_path}. Installing...\")\n\n            # 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},","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/fsharp_language_server.py#L162-L198","documentation":"Serena installs FsAutoComplete (the F# language server) via a tool such as `dotnet tool install`. If that subprocess exits non-zero, _setup_runtime_dependencies captures stderr and re-raises it as RuntimeError so you can see why the tool install failed.","triggerScenarios":"Starting the F# language server when the FsAutoComplete installation command (dotnet tool install/update) returns CalledProcessError — network failure, missing .NET SDK, unsupported .NET version, or NuGet feed unavailability.","commonSituations":".NET SDK not installed or too old for the FsAutoComplete package; corporate proxy blocking NuGet; dotnet tool path (~/.dotnet/tools) conflicts; package version incompatible with installed dotnet runtime.","solutions":["Run the install manually to see the full error: dotnet tool install --global fsautocomplete","Install a compatible .NET SDK (https://dotnet.microsoft.com/download) and check dotnet --version","Fix network/NuGet access: set HTTPS_PROXY or a working nuget.org feed","Retry starting the server after the manual install succeeds"],"exampleFix":"// before\n$ dotnet --list-sdks   # no SDKs installed\n// after\n$ # install .NET SDK, then:\n$ dotnet tool install --global fsautocomplete\n$ fsautocomplete --version\n","handlingStrategy":"try-catch","validationCode":"import shutil, subprocess\ndef can_install_fsautocomplete() -> bool:\n    return shutil.which(\"dotnet\") is not None and subprocess.run(\n        [\"dotnet\", \"--version\"], capture_output=True\n    ).returncode == 0","typeGuard":"def has_dotnet_sdk() -> bool:\n    import shutil\n    return shutil.which(\"dotnet\") is not None","tryCatchPattern":"try:\n    server = LanguageServer.create(LanguageServerId.FSHARP, ...)\nexcept RuntimeError as e:\n    if e.args and str(e.args[0]).startswith(\"Failed to install FsAutoComplete\"):\n        logger.error(\"Run `dotnet tool install --global fsautocomplete` manually; check dotnet SDK and NuGet access\")","preventionTips":["Install a compatible .NET SDK before using the F# language server","Ensure NuGet (nuget.org) is reachable; configure proxies in CI","Test `dotnet tool install --global fsautocomplete` in bootstrap scripts","Pin the fsautocomplete tool version compatible with your SDK"],"tags":["fsharp","dotnet","installation-failed","subprocess"],"backgroundTag":"dependency-install-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}