{"record":{"id":"74d0ad49b80226d7","repo":"deepseek-ai/deepseek-harness","slug":"dsh-e2b-configure-apikey-or-set-e2b-api-key","errorCode":null,"errorMessage":"dsh-e2b: configure apiKey or set E2B_API_KEY","messagePattern":"dsh-e2b: configure apiKey or set E2B_API_KEY","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/e2b/e2b/src/index.ts","lineNumber":141,"sourceCode":"  }\n\n  /**\n   * Return the shared live SDK handle.\n   * @returns the created sandbox after the configured cwd exists.\n   * @throws when E2B rejects creation or the service is disposing.\n   */\n  async getSandbox(): Promise<Sandbox> {\n    if (this.disposed) throw new Error('E2B sandbox service is disposing')\n    const sandbox = await this.ready\n    // Disposal can race the awaited sandbox readiness despite the synchronous precheck.\n    // oxlint-disable-next-line typescript/no-unnecessary-condition -- Awaiting readiness yields to disposal.\n    if (this.disposed) throw new Error('E2B sandbox service is disposing')\n    return sandbox\n  }\n\n  private validate(): void {\n    if (this.config.apiKey.length === 0) {\n      throw new Error('dsh-e2b: configure apiKey or set E2B_API_KEY')\n    }\n    if (!posix.isAbsolute(this.config.cwd)) {\n      throw new Error(`dsh-e2b: cwd must be an absolute Linux path: ${this.config.cwd}`)\n    }\n    if (!Number.isFinite(this.config.timeoutMs) || this.config.timeoutMs <= 0) {\n      throw new Error('dsh-e2b: timeoutMs must be a positive finite number')\n    }\n  }\n\n  private async open(): Promise<Sandbox> {\n    const sandbox = await Sandbox.create({\n      apiKey: this.config.apiKey,\n      timeoutMs: this.config.timeoutMs,\n      secure: true,\n      lifecycle: { onTimeout: 'kill' },\n    })\n    try {\n      await sandbox.files.makeDir(this.cwd)","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/e2b/src/index.ts#L123-L159","documentation":"Error \"dsh-e2b: configure apiKey or set E2B_API_KEY\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/e2b/src/index.ts:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}