rust-lang/rust · critical · Error
bootstrap error. See the logs in "OUTPUT > Rust Analyzer Cli
Error message
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".
What it means
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.
Source
Thrown at src/tools/rust-analyzer/editors/code/src/ctx.ts:295
await handleMsrvWarning(params.message);
},
),
);
}
return this._client;
}
private async bootstrap(): Promise<string> {
return bootstrap(this.extCtx, this.config, this.state).catch((err) => {
let message = "bootstrap error. ";
message +=
'See the logs in "OUTPUT > Rust Analyzer Client" (should open automatically).';
message +=
'To enable verbose logs, click the gear icon in the "OUTPUT" tab and select "Debug".';
log.error("Bootstrap error", err);
throw new Error(message);
});
}
async start() {
log.info("Starting language client");
const client = await this.getOrCreateClient();
if (!client) {
return;
}
await client.start();
this.updateCommands();
if (this.testController) {
prepareTestExplorer(this, this.testController, client);
}
if (this.config.showDependenciesExplorer) {
this.prepareTreeDependenciesView(client);
}View on GitHub (pinned to 7088e4b63a)
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.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await ctx.start(); // internally calls bootstrap
} catch (e) {
if (e.message.startsWith('bootstrap error')) {
// The real cause is in OUTPUT > Rust Analyzer Client, logged as 'Bootstrap error'
const action = await vscode.window.showErrorMessage(
'rust-analyzer failed to start. Check OUTPUT panel for details.',
'Open Output'
);
if (action === 'Open Output') {
vscode.commands.executeCommand('workbench.action.output.toggleOutput');
}
}
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- rust-analyzer Language Server is not available. Please, ensu
- Failed to execute ${path} --version.
- Cargo invocation has failed: ${err}
- No compilation artifacts
- Multiple compilation artifacts are not supported.
AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10).
Data as JSON: /api/errors/f66f18a59c3665d7.
Report an issue: GitHub.