{"record":{"id":"48a667fefd58f324","repo":"denoland/deno","slug":"err-fs-cp-fifo-pipe","errorCode":"ERR_FS_CP_FIFO_PIPE","errorMessage":"Cannot copy a FIFO pipe","messagePattern":"Cannot copy a FIFO pipe","errorType":"exception","errorClass":"SystemError","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/_fs/cp/cp.ts","lineNumber":108,"sourceCode":"      });\n    case \"EISDIR\":\n      throw new ERR_FS_EISDIR({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EISDIR,\n        code: \"EISDIR\",\n      });\n    case \"SOCKET\":\n      throw new ERR_FS_CP_SOCKET({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EINVAL,\n        code: \"EINVAL\",\n      });\n    case \"FIFO\":\n      throw new ERR_FS_CP_FIFO_PIPE({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EINVAL,\n        code: \"EINVAL\",\n      });\n    case \"UNKNOWN\":\n      throw new ERR_FS_CP_UNKNOWN({\n        message: err.message,\n        path: err.path,\n        syscall: \"cp\",\n        errno: EINVAL,\n        code: \"EINVAL\",\n      });\n    case \"SYMLINK_TO_SUBDIRECTORY\":\n      throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({\n        message: err.message,\n        path: err.path,","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/ext/node/polyfills/_fs/cp/cp.ts#L90-L126","documentation":"Mirror of the socket case: when the source stat identifies a FIFO (named pipe), fs.cp rejects with CpError::Fifo (kind 'FIFO'), mapped by throwCpError to ERR_FS_CP_FIFO_PIPE ('Cannot copy a FIFO pipe', errno EINVAL). A FIFO is a kernel rendezvous object with no data to read by copy; reading it would block on the writer side, so the operation is refused outright.","triggerScenarios":"fs.cp recursive over a directory containing mkfifo-created entries (logs.fifo, common in log pipelines); copying a mount that exposes device/IPC entries; test fixtures that deliberately create FIFOs being swept by a copy task.","commonSituations":"Devops scripts archiving runtime directories that contain logging or IPC FIFOs; packaging steps that walk /tmp-heavy workspaces; reproducible-build tooling hitting fixture leftovers.","solutions":["Filter out FIFOs during recursive copy via lstat + stats.isFIFO()","Remove stale FIFOs before archiving (they are recreated by their producers)","Restrict the copy to the entries you know are regular files/dirs, e.g. with a filter or explicit list"],"exampleFix":"// before\nfs.cp('runtime/', 'snap/', { recursive: true }, cb); // runtime/ has logs.fifo\n\n// after\nfs.cp('runtime/', 'snap/', {\n  recursive: true,\n  filter: (src) => !fs.lstatSync(src).isFIFO(),\n}, cb);","handlingStrategy":"validation","validationCode":"const filter = (src) => !fs.lstatSync(src).isFIFO();\nfs.cpSync(src, dest, { recursive: true, filter });","typeGuard":"const isFifoEntry = (st) => st.isFIFO();","tryCatchPattern":"try { await fs.promises.cp(src, dest, { recursive: true }); } catch (e) { if (e.code === 'ERR_FS_CP_FIFO_PIPE') { /* rerun with an isFIFO filter */ } else throw e; }","preventionTips":["Use lstat (not stat) so symlinked pipes are visible","Clean log-pipeline FIFOs out of directories you archive","Filter by file kind, not by name — FIFOs rarely end in .fifo"],"tags":["node-compat","fs","cp","copy","fifo","named-pipe","err-fs-cp-fifo-pipe","unix","deno"],"backgroundTag":"fs-cp-unsupported-file-type","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}