{"record":{"id":"1e9d7b78c20403de","repo":"deepseek-ai/deepseek-harness","slug":"fs-not-directory","errorCode":"FS_NOT_DIRECTORY","errorMessage":"cannot list \"${target.displayPath}\": not a directory","messagePattern":"cannot list \"(.+?)\": not a directory","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/e2b/fs-e2b/src/index.ts","lineNumber":349,"sourceCode":"          throw mapError(error, 'read', displayPath, signal)\n        } finally {\n          if (!completed) {\n            try {\n              await reader.cancel()\n            } catch (_streamCancellationFailure) {\n              // The primary read outcome owns the result; cancellation is best-effort after early stop.\n            }\n          }\n          reader.releaseLock()\n        }\n      },\n    }\n  }\n\n  override async listDir(target: FsTarget, signal?: AbortSignal): Promise<FsDirEntry[]> {\n    const info = await this.stat(target, signal)\n    if (info === undefined) throw new FsError(`cannot list \"${target.displayPath}\": not found`, 'FS_NOT_FOUND')\n    if (info.type !== 'directory') throw new FsError(`cannot list \"${target.displayPath}\": not a directory`, 'FS_NOT_DIRECTORY')\n    try {\n      const sandbox = await this.ctx.e2b.getSandbox()\n      const listed = await sandbox.files.list(String(target.targetKey), { depth: 1, ...signalOpts(signal) })\n      const entries: FsDirEntry[] = []\n      for (const entry of listed) {\n        const displayPath = posix.join(target.displayPath, entry.name)\n        const canonical = entry.symlinkTarget === undefined\n          ? entry.path\n          : await this.canonicalPath(sandbox, entry.path, signal)\n        const resolved = entry.symlinkTarget === undefined\n          ? entry\n          : await this.probe(canonical, displayPath, signal)\n        entries.push({\n          name: entry.name,\n          type: resolved === undefined ? 'other' : entryType(resolved),\n          target: { targetKey: FsTargetKey(canonical), displayPath },\n          ...(resolved !== undefined ? { version: entryVersion(resolved) } : {}),\n          ...(resolved?.type === FileType.FILE ? { size: resolved.size } : {}),","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/e2b/fs-e2b/src/index.ts#L331-L367","documentation":"Error \"cannot list \"${target.displayPath}\": not a directory\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/e2b/fs-e2b/src/index.ts:349 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"}