{"record":{"id":"a053c0f17084b624","repo":"deepseek-ai/deepseek-harness","slug":"fs-io-error","errorCode":"FS_IO_ERROR","errorMessage":"cannot write \"${displayPath}\": ${errorMessage(metadataError)}","messagePattern":"cannot write \"(.+?)\": (.+?)","errorType":"exception","errorClass":"FsError","httpStatus":null,"severity":"error","filePath":"packages/fs/fs-local/src/fsio.ts","lineNumber":492,"sourceCode":"  } catch (cleanupError: unknown) {\n    /* v8 ignore next 1 -- cleanup failure here needs a second filesystem fault after the primary write failure. */\n    throw new FsError(`write failed (${errorMessage(originalError)}) and temp cleanup failed (${errorMessage(cleanupError)})`, 'FS_NOT_FOUND', { cause: originalError })\n  }\n  throw originalError\n}\n\nasync function throwGuardedCreateFailure(\n  error: unknown,\n  absolutePath: string,\n  displayPath: string,\n  inspectPublicationTarget: (path: string) => Promise<BigIntStats>,\n): Promise<never> {\n  let existing: BigIntStats | undefined\n  try {\n    existing = await inspectPublicationTarget(absolutePath)\n  } catch (metadataError: unknown) {\n    if (!isENOENT(metadataError) && !isENOTDIR(metadataError)) {\n      throw new FsError(`cannot write \"${displayPath}\": ${errorMessage(metadataError)}`, 'FS_IO_ERROR', { cause: metadataError })\n    }\n  }\n\n  // Link errno values vary by platform and filesystem. Inspect the target entry\n  // after failure so a collision is not confused with missing hard-link support.\n  if (existing !== undefined) {\n    if (!existing.isFile()) {\n      throw new FsError(`cannot write \"${displayPath}\": not a regular file`, 'FS_NOT_REGULAR_FILE', { cause: error })\n    }\n    throw new FsError(\n      `cannot overwrite existing \"${displayPath}\" without reading it first`,\n      'FS_NOT_OBSERVED',\n      { cause: error },\n    )\n  }\n  if (isEEXIST(error)) {\n    throw new FsError(\n      `cannot overwrite existing \"${displayPath}\" without reading it first`,","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/fs/fs-local/src/fsio.ts#L474-L510","documentation":"Error \"cannot write \"${displayPath}\": ${errorMessage(metadataError)}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/fs/fs-local/src/fsio.ts:492 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"}