deepseek-ai/deepseek-harness · error · Error
fs-e2b: canonical path transport returned invalid NUL…
Error message
fs-e2b: canonical path transport returned invalid NUL framing
What it means
Transport invariant in decodeCanonicalPath: the decoded buffer is not valid NUL-terminated framing — wrong length, missing trailing NUL, or embedded NULs. The canonicalize command's output contract is a single NUL-terminated path; violations mean corrupted transport output, not bad user input.
Solutions
- Retry the filesystem operation
- Check sandbox shell health if the corruption persists
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at packages/e2b/fs-e2b/src/index.ts:73 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/97318dc1f74670af.
Report an issue: GitHub.
Appendix: source
Thrown at packages/e2b/fs-e2b/src/index.ts:73
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
}
function signalOpts(signal: AbortSignal | undefined): { signal?: AbortSignal } {
return signal === undefined ? {} : { signal }
}
function commandOpts(signal: AbortSignal | undefined): { envs: Record<string, string>; signal?: AbortSignal } {
return { envs: e2bControlEnvs(), ...signalOpts(signal) }
}View on GitHub (pinned to b150a551b8)