{"record":{"id":"f66f18a59c3665d7","repo":"rust-lang/rust","slug":"bootstrap-error-see-the-logs-in-output-rust-an","errorCode":null,"errorMessage":"bootstrap error. See the logs in \"OUTPUT > Rust Analyzer Client\" (should open automatically).To enable verbose logs, click the gear icon in the \"OUTPUT\" tab and select \"Debug\".","messagePattern":"bootstrap error\\. See the logs in \"OUTPUT > Rust Analyzer Client\" \\(should open automatically\\)\\.To enable verbose logs, click the gear icon in the \"OUTPUT\" tab and select \"Debug\"\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/tools/rust-analyzer/editors/code/src/ctx.ts","lineNumber":295,"sourceCode":"                        await handleMsrvWarning(params.message);\n                    },\n                ),\n            );\n        }\n        return this._client;\n    }\n\n    private async bootstrap(): Promise<string> {\n        return bootstrap(this.extCtx, this.config, this.state).catch((err) => {\n            let message = \"bootstrap error. \";\n\n            message +=\n                'See the logs in \"OUTPUT > Rust Analyzer Client\" (should open automatically).';\n            message +=\n                'To enable verbose logs, click the gear icon in the \"OUTPUT\" tab and select \"Debug\".';\n\n            log.error(\"Bootstrap error\", err);\n            throw new Error(message);\n        });\n    }\n\n    async start() {\n        log.info(\"Starting language client\");\n        const client = await this.getOrCreateClient();\n        if (!client) {\n            return;\n        }\n        await client.start();\n        this.updateCommands();\n\n        if (this.testController) {\n            prepareTestExplorer(this, this.testController, client);\n        }\n        if (this.config.showDependenciesExplorer) {\n            this.prepareTreeDependenciesView(client);\n        }","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/rust-analyzer/editors/code/src/ctx.ts#L277-L313","documentation":"A catch-all wrapper thrown by Ctx.bootstrap() at ctx.ts:286-296. It catches any rejection from the bootstrap() function (errors [0] and [1] and any other failure during server resolution), logs the original error with log.error('Bootstrap error', err), and re-throws a new Error with a user-facing message that directs to the 'OUTPUT > Rust Analyzer Client' panel. The original cause is only in the logs, not in the re-thrown message.","triggerScenarios":"bootstrap(this.extCtx, this.config, this.state) rejects at ctx.ts:286. The .catch handler wraps it. This fires for any error thrown inside bootstrap() — the server-not-available error (index 0), the --version execution failure (index 1), or any unexpected exception during getServer() (e.g. a spawnAsync rejection, a filesystem error, or a NixOS patchelf failure).","commonSituations":"The user sees this generic message in a VS Code error notification without knowing the root cause. The real error is in the OUTPUT panel. Common underlying causes: missing rust-analyzer binary, wrong serverPath, broken toolchain, NixOS patching failure, or a transient filesystem/spawn error during startup.","solutions":["Open the OUTPUT panel in VS Code (View > Output), select 'Rust Analyzer Client' from the dropdown, and read the 'Bootstrap error' log line which contains the original cause.","Set the OUTPUT log level to Debug (gear icon in OUTPUT tab) and reload the window to capture a full verbose trace of the bootstrap.","Address the underlying error identified in the log (typically error index 0 or index 1).","If the log shows a NixOS patchelf failure, ensure nix-build is available and <nixpkgs> is importable.","Reload the VS Code window (Developer: Reload Window) after fixing the root cause to re-trigger bootstrap."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await ctx.start(); // internally calls bootstrap\n} catch (e) {\n  if (e.message.startsWith('bootstrap error')) {\n    // The real cause is in OUTPUT > Rust Analyzer Client, logged as 'Bootstrap error'\n    const action = await vscode.window.showErrorMessage(\n      'rust-analyzer failed to start. Check OUTPUT panel for details.',\n      'Open Output'\n    );\n    if (action === 'Open Output') {\n      vscode.commands.executeCommand('workbench.action.output.toggleOutput');\n    }\n  }\n}","preventionTips":["When debugging bootstrap failures, always check the OUTPUT > Rust Analyzer Client panel — the re-thrown message hides the root cause.","Set the OUTPUT log level to Debug before reloading to capture verbose bootstrap traces.","Keep the extension and rust-analyzer toolchain versions in sync to avoid compatibility issues."],"tags":["rust-analyzer","vscode-extension","bootstrap","error-wrapping","logging"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}