deepseek-ai/deepseek-harness · error · Error

dsh-e2b: runtime root must be a real directory

Error message

dsh-e2b: runtime root must be a real directory: ${this.runtimeRoot}

What it means

Runtime check in the E2B service's open(): the configured runtimeRoot path does not resolve to a real directory inside the sandbox after creation. The shared runtime directory the Python runtime expects is missing or is not a directory, so sandbox bring-up fails with the configured path shown.

Solutions

  1. Point runtimeRoot at an existing directory path inside the sandbox image
  2. Check that sandbox creation and makeDir succeeded for the runtime root
  3. Fix path configuration that names a file or an unavailable location
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/e2b/e2b/src/index.ts:163 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/9240f5c6eb0bf5d7. Report an issue: GitHub.

Appendix: source

Thrown at packages/e2b/e2b/src/index.ts:163

    }
    if (!Number.isFinite(this.config.timeoutMs) || this.config.timeoutMs <= 0) {
      throw new Error('dsh-e2b: timeoutMs must be a positive finite number')
    }
  }

  private async open(): Promise<Sandbox> {
    const sandbox = await Sandbox.create({
      apiKey: this.config.apiKey,
      timeoutMs: this.config.timeoutMs,
      secure: true,
      lifecycle: { onTimeout: 'kill' },
    })
    try {
      await sandbox.files.makeDir(this.cwd)
      await sandbox.files.makeDir(this.runtimeRoot)
      const runtimeRoot = await sandbox.files.getInfo(this.runtimeRoot)
      if (runtimeRoot.type !== FileType.DIR || runtimeRoot.symlinkTarget !== undefined) {
        throw new Error(`dsh-e2b: runtime root must be a real directory: ${this.runtimeRoot}`)
      }
      await sandbox.commands.run(
        `chmod 700 -- ${quoteE2BShellArg(this.runtimeRoot)}`,
        { envs: e2bControlEnvs() },
      )
      return sandbox
    } catch (error: unknown) {
      try {
        await sandbox.kill()
      } catch (_sandboxSetupRollbackFailure) {
        // TODO(e2b-setup-rollback): Add retry state only if a real double failure
        // outlives E2B's configured sandbox timeout.
      }
      throw error
    }
  }
}

View on GitHub (pinned to b150a551b8)