oraios/serena · error · FileNotFoundError

FsAutoComplete executable not found at {fsautocomplete_path}

Error message

FsAutoComplete executable not found at {fsautocomplete_path}, something went wrong with the installation.

What it means

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.

Source

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

            # 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},
                    "didChangeConfiguration": {"dynamicRegistration": True},
                    "didChangeWatchedFiles": {"dynamicRegistration": True},

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Run: dotnet tool install --global fsautocomplete (or update) and ensure it reports success
  2. Add ~/.dotnet/tools to PATH (export PATH="$PATH:$HOME/.dotnet/tools") for the process running Serena
  3. Verify with: which fsautocomplete, then restart Serena
  4. If installed under a different user/home, install as the same user Serena runs as

Example fix

// before
$ which fsautocomplete   # not found (tools dir not on PATH)
// after
$ export PATH="$PATH:$HOME/.dotnet/tools"
$ which fsautocomplete
/home/user/.dotnet/tools/fsautocomplete
Defensive patterns

Strategy: validation

Validate before calling

import os, shutil
def fsautocomplete_available() -> bool:
    home = os.path.expanduser("~/.dotnet/tools")
    return shutil.which("fsautocomplete") is not None or os.path.exists(
        os.path.join(home, "fsautocomplete")
    )

Type guard

def executable_exists(path: str) -> bool:
    import os
    return os.path.isfile(path) and os.access(path, os.X_OK)

Try / catch

try:
    server = LanguageServer.create(LanguageServerId.FSHARP, ...)
except FileNotFoundError as e:
    if "FsAutoComplete" in str(e):
        logger.error("Add ~/.dotnet/tools to PATH and run `dotnet tool install --global fsautocomplete`")

Prevention

When it happens

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

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

Related errors


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