denoland/deno · error · NodeSystemError

ERR_FS_CP_FIFO_PIPE

ERR_FS_CP_FIFO_PIPE

Error message

Cannot copy a FIFO pipe

What it means

Mirror of the socket case: kind 'FIFO' from the native cp validation becomes ERR_FS_CP_FIFO_PIPE ('Cannot copy a FIFO pipe'). Named pipes (created with mkfifo) have a reader/writer semantic, not stored bytes, so copying their 'content' is meaningless and fs.cp rejects them.

Source

Thrown at ext/node/polyfills/_fs/cp/cp.ts:108

      });
    case "EISDIR":
      throw new ERR_FS_EISDIR({
        message: err.message,
        path: err.path,
        syscall: "cp",
        errno: EISDIR,
        code: "EISDIR",
      });
    case "SOCKET":
      throw new ERR_FS_CP_SOCKET({
        message: err.message,
        path: err.path,
        syscall: "cp",
        errno: EINVAL,
        code: "EINVAL",
      });
    case "FIFO":
      throw new ERR_FS_CP_FIFO_PIPE({
        message: err.message,
        path: err.path,
        syscall: "cp",
        errno: EINVAL,
        code: "EINVAL",
      });
    case "UNKNOWN":
      throw new ERR_FS_CP_UNKNOWN({
        message: err.message,
        path: err.path,
        syscall: "cp",
        errno: EINVAL,
        code: "EINVAL",
      });
    case "SYMLINK_TO_SUBDIRECTORY":
      throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({
        message: err.message,
        path: err.path,

View on GitHub (pinned to 89f33cbef2)

Solutions

  1. Add a filter that skips FIFOs: check stats.isFIFO()
  2. Exclude runtime/FIFO directories from the copy set explicitly
  3. Delete stale FIFOs before deploying over them

Example fix

// before
await fsp.cp(runDir, backupDir, { recursive: true, dereference: true });

// after
await fsp.cp(runDir, backupDir, {
  recursive: true,
  dereference: true,
  filter: async (s) => !(await fsp.lstat(s)).isFIFO(),
});
Defensive patterns

Strategy: validation

Validate before calling

const filter = async (s) => !(await fsp.lstat(s)).isFIFO();
await fsp.cp(src, dest, { recursive: true, dereference: true, filter });

Type guard

async function isFifoPath(p) { try { return (await fsp.lstat(p)).isFIFO(); } catch { return false; } }

Try / catch

try { await fsp.cp(src, dest, { recursive: true, dereference: true }); } catch (e) { if (e.code === 'ERR_FS_CP_FIFO_PIPE') { /* skip FIFO and retry */ } else throw e; }

Prevention

When it happens

Trigger: Recursive copy with dereference over a directory containing FIFOs (e.g. mpd's control pipe, logging pipes under /run); deploying a tree that includes a fixture FIFO created by a test.

Common situations: Packaging scripts that snapshot service runtime directories; CI caches containing named pipes created by integration tests.

Related errors


AI-assisted analysis of denoland/deno@89f33cbef2 (2026-08-16). Data as JSON: /api/errors/48a667fefd58f324. Report an issue: GitHub.