{"record":{"id":"b0d0ab4d8714ef8b","repo":"hashicorp/nomad","slug":"failed-to-open-fifo-listener-v","errorCode":null,"errorMessage":"failed to open fifo listener: %v","messagePattern":"failed to open fifo listener: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/lib/fifo/fifo_windows.go","lineNumber":103,"sourceCode":"\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\n// OpenWriter opens a fifo that already exists and returns an io.WriteCloser for it\nfunc OpenWriter(path string) (io.WriteCloser, error) {\n\treturn winio.DialPipe(path, nil)\n}\n\n// Remove a fifo that already exists at a given path\nfunc Remove(path string) error {\n\tdur := 500 * time.Millisecond\n\tconn, err := winio.DialPipe(path, &dur)\n\tif err == nil {\n\t\treturn conn.Close()\n\t}\n","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/lib/fifo/fifo_windows.go#L85-L121","documentation":"On Windows, OpenReader creates a listen-only named pipe server via winio.ListenOnlyPipe. This error is returned when ListenOnlyPipe fails, i.e. the pipe server could not be established for the given name.","triggerScenarios":"Calling fifo.OpenReader(path) with a malformed pipe path, a name already in use by another pipe server, or insufficient privileges to create a named pipe.","commonSituations":"Two log consumers opening the same pipe name simultaneously; stale pipe server from a crashed process still registered; path missing the \\\\.\\pipe\\ prefix; restricted container/service context denying pipe creation.","solutions":["Use a unique, correctly formatted \\\\.\\pipe\\<name> path","Ensure the previous listener is closed before reopening the same name","Run under an account permitted to create named pipes","Retry with a fresh pipe name if the old name is leaked"],"exampleFix":"// before\nr, err := fifo.OpenReader(`\\\\.\\pipe\\logs`)\n// after\nr, err := fifo.OpenReader(fmt.Sprintf(`\\\\.\\pipe\\containerd-logs-%d`, os.Getpid()))","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.OpenReader(pipePath)\nif err != nil {\n\t// name collision or stale listener; retry with backoff or new name\n\treturn fmt.Errorf(\"open pipe listener %s: %w\", pipePath, err)\n}","preventionTips":["Ensure only one listener per pipe name","Close the previous winFIFO listener before reopening","Include a unique suffix (pid/uuid) in pipe names","Verify service/container permissions for named pipes"],"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"}