Fission-AI/OpenSpec · error · Error

Could not safely stage ${src} before the fallback archive co

Error message

Could not safely stage ${src} before the fallback archive copy (${stageError instanceof Error ? stageError.message : String(stageError)}). No fallback copy was attempted.

What it means

Error "Could not safely stage ${src} before the fallback archive copy (${stageError instanceof Error ? stageError.message : String(stageError)}). No fallback copy was attempted." thrown in Fission-AI/OpenSpec.

Source

Thrown at src/core/archive.ts:501

): Promise<void> {
  try {
    await fs.rename(src, dest);
  } catch (err: any) {
    const code = err?.code;
    // rename onto a non-empty directory: the destination was taken while the
    // archive was running. Same condition the pre-flight check reports.
    if (code === 'ENOTEMPTY' || code === 'EEXIST') {
      throw new ArchiveBlockedError(
        'archive_target_exists',
        `Archive '${path.basename(dest)}' already exists.`
      );
    }
    if (code === 'EPERM' || code === 'EXDEV') {
      const stagedSource = path.join(path.dirname(src), `.openspec-move-${randomUUID()}`);
      try {
        await fs.rename(src, stagedSource);
      } catch (stageError) {
        throw new Error(
          `Could not safely stage ${src} before the fallback archive copy ` +
            `(${stageError instanceof Error ? stageError.message : String(stageError)}). ` +
            'No fallback copy was attempted.'
        );
      }
      let destIsOurs = false;
      let stagedFingerprint: string;
      try {
        stagedFingerprint = await fingerprintDirectoryContents(stagedSource);
        await fs.mkdir(dest, { mode: 0o700 });
        destIsOurs = true;
        await copyDirContents(stagedSource, dest);
        await options.verifyCopiedDestination?.(stagedSource);
        await assertCopiedDirectoryUnchanged(stagedSource, dest, stagedFingerprint);
      } catch (copyError) {
        if (destIsOurs) {
          await fs.rm(dest, { recursive: true, force: true }).catch(() => undefined);
        }

View on GitHub (pinned to 6926ccb18a)

When it happens

Trigger: Thrown at src/core/archive.ts:501 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/318920fcfeca6c80. Report an issue: GitHub.