{"record":{"id":"a803b96633b40f40","repo":"deepseek-ai/deepseek-harness","slug":"fs-e2b-canonical-path-transport-returned-invalid","errorCode":null,"errorMessage":"fs-e2b: canonical path transport returned invalid base64","messagePattern":"fs-e2b: canonical path transport returned invalid base64","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/e2b/fs-e2b/src/index.ts","lineNumber":66,"sourceCode":"\nfunction restoreLineEndings(value: string, crlf: boolean): string {\n  return crlf ? normalizeLineEndings(value).replaceAll('\\n', '\\r\\n') : value\n}\n\nfunction decodeText(bytes: Uint8Array, displayPath: string, binarySampleBytes: number): string {\n  if (bytes.subarray(0, binarySampleBytes).includes(0)) {\n    throw new FsError(`cannot read \"${displayPath}\": binary file`, 'FS_NOT_TEXT')\n  }\n  try {\n    return new TextDecoder('utf-8', { fatal: true }).decode(bytes)\n  } catch (error: unknown) {\n    throw new FsError(`cannot read \"${displayPath}\": invalid UTF-8 text`, 'FS_NOT_TEXT', { cause: error })\n  }\n}\n\nfunction decodeCanonicalPath(encoded: string): string {\n  if (encoded.length === 0 || !BASE64.test(encoded)) {\n    throw new Error('fs-e2b: canonical path transport returned invalid base64')\n  }\n  const framed = Buffer.from(encoded, 'base64')\n  if (framed.toString('base64') !== encoded\n    || framed.length < 2\n    || framed.at(-1) !== 0\n    || framed.subarray(0, -1).includes(0)) {\n    throw new Error('fs-e2b: canonical path transport returned invalid NUL framing')\n  }\n  let path: string\n  try {\n    path = new TextDecoder('utf-8', { fatal: true }).decode(framed.subarray(0, -1))\n  } catch (error: unknown) {\n    throw new Error('fs-e2b: canonical path is not valid UTF-8', { cause: error })\n  }\n  if (!posix.isAbsolute(path)) throw new Error('fs-e2b: canonical path is not absolute')\n  return path\n}\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/fs-e2b/src/index.ts#L48-L84","documentation":"Error \"fs-e2b: canonical path transport returned invalid base64\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/fs-e2b/src/index.ts:66 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"}