oraios/serena · error · RuntimeError

Failed to install FsAutoComplete: {e.stderr}

Error message

Failed to install FsAutoComplete: {e.stderr}

What it means

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.

Source

Thrown at src/solidlsp/language_servers/fsharp_language_server.py:180

            log.info(f"FsAutoComplete executable not found at {fsautocomplete_path}. Installing...")

            # Ensure the directory exists
            os.makedirs(fsharp_ls_dir, exist_ok=True)

            # Install FsAutoComplete using dotnet tool install
            try:
                result = subprocess_run(
                    [dotnet_exe, "tool", "install", "--tool-path", fsharp_ls_dir, "fsautocomplete", "--version", fsautocomplete_version],
                    cwd=fsharp_ls_dir,
                    capture_output=True,
                    text=True,
                    check=True,
                )
                log.info("FsAutoComplete installed successfully")
                log.debug(f"Installation output: {result.stdout}")
            except subprocess.CalledProcessError as e:
                log.error(f"Failed to install FsAutoComplete: {e.stderr}")
                raise RuntimeError(f"Failed to install FsAutoComplete: {e.stderr}")

        if not os.path.exists(fsautocomplete_path):
            raise FileNotFoundError(
                f"FsAutoComplete executable not found at {fsautocomplete_path}, something went wrong with the installation."
            )

        # FsAutoComplete uses --lsp flag for LSP mode
        return f"{fsautocomplete_path} --adaptive-lsp-server-enabled --project-graph-enabled --use-fcs-transparent-compiler"

    def _create_base_initialize_params(self) -> dict:
        """
        Returns the initialize params for the F# Language Server.
        """
        initialize_params = {
            "capabilities": {
                "workspace": {
                    "applyEdit": True,
                    "workspaceEdit": {"documentChanges": True},

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Run the install manually to see the full error: dotnet tool install --global fsautocomplete
  2. Install a compatible .NET SDK (https://dotnet.microsoft.com/download) and check dotnet --version
  3. Fix network/NuGet access: set HTTPS_PROXY or a working nuget.org feed
  4. Retry starting the server after the manual install succeeds

Example fix

// before
$ dotnet --list-sdks   # no SDKs installed
// after
$ # install .NET SDK, then:
$ dotnet tool install --global fsautocomplete
$ fsautocomplete --version
Defensive patterns

Strategy: try-catch

Validate before calling

import shutil, subprocess
def can_install_fsautocomplete() -> bool:
    return shutil.which("dotnet") is not None and subprocess.run(
        ["dotnet", "--version"], capture_output=True
    ).returncode == 0

Type guard

def has_dotnet_sdk() -> bool:
    import shutil
    return shutil.which("dotnet") is not None

Try / catch

try:
    server = LanguageServer.create(LanguageServerId.FSHARP, ...)
except RuntimeError as e:
    if e.args and str(e.args[0]).startswith("Failed to install FsAutoComplete"):
        logger.error("Run `dotnet tool install --global fsautocomplete` manually; check dotnet SDK and NuGet access")

Prevention

When it happens

Trigger: 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.

Common situations: .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.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/fcac1c0c5b8a2b83. Report an issue: GitHub.