deepseek-ai/deepseek-harness · error · Error
fs-e2b: canonical path transport returned invalid base64
Error message
fs-e2b: canonical path transport returned invalid base64
What it means
Transport invariant in decodeCanonicalPath: the base64 string echoed back by the E2B canonicalize command fails base64 grammar or round-trip re-encoding. This is an internal shell-transport contract violation (corrupted command output), not user input — the decoded path could not be trusted.
Solutions
- Retry the operation; transient shell output corruption may not recur
- Inspect the sandbox's shell health if it persists
- Report as an internal transport bug rather than adjusting inputs
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at packages/e2b/fs-e2b/src/index.ts:66 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/a803b96633b40f40.
Report an issue: GitHub.
Appendix: source
Thrown at packages/e2b/fs-e2b/src/index.ts:66
function restoreLineEndings(value: string, crlf: boolean): string {
return crlf ? normalizeLineEndings(value).replaceAll('\n', '\r\n') : value
}
function decodeText(bytes: Uint8Array, displayPath: string, binarySampleBytes: number): string {
if (bytes.subarray(0, binarySampleBytes).includes(0)) {
throw new FsError(`cannot read "${displayPath}": binary file`, 'FS_NOT_TEXT')
}
try {
return new TextDecoder('utf-8', { fatal: true }).decode(bytes)
} catch (error: unknown) {
throw new FsError(`cannot read "${displayPath}": invalid UTF-8 text`, 'FS_NOT_TEXT', { cause: error })
}
}
function decodeCanonicalPath(encoded: string): string {
if (encoded.length === 0 || !BASE64.test(encoded)) {
throw new Error('fs-e2b: canonical path transport returned invalid base64')
}
const framed = Buffer.from(encoded, 'base64')
if (framed.toString('base64') !== encoded
|| framed.length < 2
|| framed.at(-1) !== 0
|| framed.subarray(0, -1).includes(0)) {
throw new Error('fs-e2b: canonical path transport returned invalid NUL framing')
}
let path: string
try {
path = new TextDecoder('utf-8', { fatal: true }).decode(framed.subarray(0, -1))
} catch (error: unknown) {
throw new Error('fs-e2b: canonical path is not valid UTF-8', { cause: error })
}
if (!posix.isAbsolute(path)) throw new Error('fs-e2b: canonical path is not absolute')
return path
}
View on GitHub (pinned to b150a551b8)