Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib/build-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ export function printSandboxCreateRecoveryHints(output = ""): void {
);
return;
}
if (failure.kind === "tls_cert_mismatch") {
console.error(" Hint: TLS certificate mismatch — the gateway certificate changed since the CLI last trusted it.");
console.error(" Fix: openshell gateway trust -g nemoclaw");
console.error(" Then: nemoclaw onboard --resume");
return;
}
console.error(" Recovery: nemoclaw onboard --resume");
console.error(" Or: nemoclaw onboard");
}
15 changes: 15 additions & 0 deletions src/lib/validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ describe("classifySandboxCreateFailure", () => {
const result = classifySandboxCreateFailure("something else happened");
expect(result.kind).toBe("unknown");
});

it("detects TLS cert error from 'invalid peer certificate: BadSignature'", () => {
const result = classifySandboxCreateFailure("invalid peer certificate: BadSignature");
expect(result.kind).toBe("tls_cert_mismatch");
});

it("detects TLS cert error from 'handshake verification failed'", () => {
const result = classifySandboxCreateFailure("handshake verification failed");
expect(result.kind).toBe("tls_cert_mismatch");
});

it("detects TLS cert error from 'certificate verify failed'", () => {
const result = classifySandboxCreateFailure("certificate verify failed");
expect(result.kind).toBe("tls_cert_mismatch");
});
});

describe("validateNvidiaApiKeyValue", () => {
Expand Down
5 changes: 4 additions & 1 deletion src/lib/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ValidationClassification {
}

export interface SandboxCreateFailure {
kind: "image_transfer_timeout" | "image_transfer_reset" | "sandbox_create_incomplete" | "unknown";
kind: "image_transfer_timeout" | "image_transfer_reset" | "sandbox_create_incomplete" | "tls_cert_mismatch" | "unknown";
uploadedToGateway: boolean;
}

Expand Down Expand Up @@ -66,6 +66,9 @@ export function classifySandboxCreateFailure(output = ""): SandboxCreateFailure
if (/Created sandbox:/i.test(text)) {
return { kind: "sandbox_create_incomplete", uploadedToGateway: true };
}
if (/invalid peer certificate|BadSignature|handshake verification failed|certificate verify failed|tls.*error|ssl.*error/i.test(text)) {
return { kind: "tls_cert_mismatch", uploadedToGateway };
}
return { kind: "unknown", uploadedToGateway };
}

Expand Down
Loading