{"record":{"id":"f7d3adbcf615e787","repo":"oraios/serena","slug":"failed-to-start-f-language-server-e","errorCode":null,"errorMessage":"Failed to start F# language server: {e}","messagePattern":"Failed to start F# language server: (.+?)","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/fsharp_language_server.py","lineNumber":412,"sourceCode":"            \"\"\"Handle window/workDoneProgress/create requests from the LSP server.\"\"\"\n            # Just acknowledge the request - we don't need to track progress for now\n            return\n\n        # Register custom handlers\n        self.server.on_notification(\"window/logMessage\", handle_window_log_message)\n        self.server.on_notification(\"window/showMessage\", handle_window_show_message)\n        self.server.on_request(\"workspace/configuration\", handle_workspace_configuration)\n        self.server.on_request(\"client/registerCapability\", handle_client_register_capability)\n        self.server.on_request(\"client/unregisterCapability\", handle_client_unregister_capability)\n        self.server.on_request(\"window/workDoneProgress/create\", handle_work_done_progress_create)\n\n        log.info(\"Starting FsAutoComplete F# language server process\")\n\n        try:\n            self.server.start()\n        except Exception as e:\n            log.error(f\"Failed to start F# language server process: {e}\")\n            raise SolidLSPException(f\"Failed to start F# language server: {e}\")\n\n        # Send initialization\n        initialize_params = self._create_initialize_params()\n\n        log.info(\"Sending initialize request to F# language server\")\n        try:\n            self.server.send.initialize(initialize_params)\n            log.debug(\"Received initialize response from F# language server\")\n        except Exception as e:\n            raise SolidLSPException(f\"Failed to initialize F# language server for {self.repository_root_path}: {e}\") from e\n\n        # Complete initialization\n        self.server.notify.initialized({})\n\n        log.info(\"F# language server initialized successfully\")\n\n    @override\n    def _get_wait_time_for_cross_file_referencing(self) -> float:","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/fsharp_language_server.py#L394-L430","documentation":"When the underlying LSP process wrapper (self.server.start()) fails to launch the FsAutoComplete process, _start_server logs the cause and re-raises it as SolidLSPException. This typically means the command line, working directory, or environment made the server process die immediately at startup.","triggerScenarios":"Calling _start_server where self.server.start() throws — fsautocomplete binary not executable/found at launch time, missing dotnet runtime when executing the wrapper script, bad cwd, or an exception raised while spawning the process.","commonSituations":"FsAutoComplete crashed on startup due to a missing/broken .NET runtime; binary installed but PATH/cwd invalid at runtime; port/resource conflicts or permissions preventing process spawn.","solutions":["Run fsautocomplete manually with the same flags to see the crash: fsautocomplete --adaptive-lsp-server-enabled --project-graph-enabled --use-fcs-transparent-compiler","Verify the .NET runtime works: dotnet --info, and reinstall FsAutoComplete if broken","Check that the repository_root_path (cwd) exists and is readable by the process","Read the preceding log.error line ('Failed to start F# language server process: ...') for the root cause and fix that underlying exception"],"exampleFix":"// before\n$ fsautocomplete --adaptive-lsp-server-enabled   # fails: dotnet runtime missing\n// after\n$ dotnet --info        # verify runtime\n$ dotnet tool update --global fsautocomplete\n$ fsautocomplete --adaptive-lsp-server-enabled   # starts OK; then restart Serena\n","handlingStrategy":"try-catch","validationCode":"import shutil, subprocess\ndef fsautocomplete_launchable() -> bool:\n    exe = shutil.which(\"fsautocomplete\")\n    if not exe:\n        return False\n    r = subprocess.run([exe, \"--help\"], capture_output=True, timeout=10)\n    return r.returncode == 0","typeGuard":"def server_process_can_start(cmd: list[str], cwd: str) -> bool:\n    import os, shutil\n    return bool(cwd and os.path.isdir(cwd)) and shutil.which(cmd[0]) is not None","tryCatchPattern":"try:\n    server = LanguageServer.create(LanguageServerId.FSHARP, ...)\nexcept SolidLSPException as e:\n    logger.error(\"F# LS failed to start: %s\", e)\n    # check underlying cause: dotnet runtime, cwd, binary permissions","preventionTips":["Run fsautocomplete manually with the same flags to reproduce startup crashes","Keep the .NET runtime healthy (`dotnet --info`) and reinstall tools after SDK upgrades","Ensure the repository root passed to the server exists and is readable","Check Serena logs just before the SolidLSPException for the root exception message"],"tags":["fsharp","language-server","process-start","dotnet"],"backgroundTag":"language-server-start-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}