{"record":{"id":"8390f1d417baba68","repo":"hashicorp/nomad","slug":"failed-to-create-fifo-v","errorCode":null,"errorMessage":"failed to create fifo: %v","messagePattern":"failed to create fifo: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/lib/fifo/fifo_windows.go","lineNumber":90,"sourceCode":"\nfunc (f *winFIFO) Close() error {\n\tf.connLock.Lock()\n\tif f.conn != nil {\n\t\tf.conn.Close()\n\t}\n\tf.connLock.Unlock()\n\treturn f.listener.Close()\n}\n\n// CreateAndRead creates a fifo at the given path and returns an io.ReadCloser open for it.\n// The fifo must not already exist\nfunc CreateAndRead(path string) (func() (io.ReadCloser, error), error) {\n\tl, err := winio.ListenPipe(path, &winio.PipeConfig{\n\t\tInputBufferSize:  PipeBufferSize,\n\t\tOutputBufferSize: PipeBufferSize,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create fifo: %v\", err)\n\t}\n\n\treturn func() (io.ReadCloser, error) {\n\t\treturn &winFIFO{\n\t\t\tlistener: l,\n\t\t}, nil\n\t}, nil\n}\n\nfunc OpenReader(path string) (io.ReadCloser, error) {\n\tl, err := winio.ListenOnlyPipe(path, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open fifo listener: %v\", err)\n\t}\n\n\treturn &winFIFO{listener: l}, nil\n}\n","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/lib/fifo/fifo_windows.go#L72-L108","documentation":"On Windows, FIFOs are named pipes. CreateAndRead creates a named pipe server with winio.ListenPipe and returns a function that produces read ends. This error wraps a failure of ListenPipe, so the pipe server could not be created at all.","triggerScenarios":"Calling fifo.CreateAndRead(path) with an invalid named-pipe path (must be \\\\.\\pipe\\...), a pipe with the same name already existing, or the pipe namespace being inaccessible.","commonSituations":"Path not in the \\\\.\\pipe\\ namespace; another process (or a leaked prior instance) already owns the pipe name; running in an environment (containers, restricted service accounts) where named pipe creation is denied.","solutions":["Use a valid named pipe path of the form \\\\.\\pipe\\<name>","Ensure no other listener holds the same pipe name; close leaked pipes or pick a unique name","Check that the user/service account can create named pipes (SeCreateNamedPipePrivilege)","Close prior CreateAndRead listeners before creating again"],"exampleFix":"// before\nr, err := fifo.CreateAndRead(\"mylogpipe\")\n// after\nr, err := fifo.CreateAndRead(`\\\\.\\pipe\\containerd-logs-mylogpipe`)","handlingStrategy":"try-catch","validationCode":"if !strings.HasPrefix(path, `\\\\.\\pipe\\`) {\n\treturn fmt.Errorf(\"invalid named pipe path: %s\", path)\n}","typeGuard":null,"tryCatchPattern":"r, err := fifo.CreateAndRead(pipePath)\nif err != nil {\n\t// pipe name may be in use; retry with unique name or after cleanup\n\treturn fmt.Errorf(\"create pipe %s: %w\", pipePath, err)\n}","preventionTips":["Always use \\\\.\\pipe\\<name> paths on Windows","Use unique pipe names per process/container instance","Close prior listeners before re-creating the same pipe","Run under an account with named-pipe creation privileges"],"tags":["go","windows","named-pipe"],"backgroundTag":"named-pipe-create-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}