{"record":{"id":"bdda4737e3564d0d","repo":"docker/compose","slug":"named-pipes-are-only-available-on-windows","errorCode":null,"errorMessage":"named pipes are only available on Windows","messagePattern":"named pipes are only available on Windows","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/memnet/conn_unix.go","lineNumber":31,"sourceCode":"   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n*/\n\npackage memnet\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net\"\n\t\"syscall\"\n)\n\nconst maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path)\n\nfunc dialNamedPipe(_ context.Context, _ string) (net.Conn, error) {\n\treturn nil, fmt.Errorf(\"named pipes are only available on Windows\")\n}\n\nfunc validateSocketPath(addr string) error {\n\tif len(addr) > maxUnixSocketPathSize {\n\t\treturn fmt.Errorf(\"socket address is too long: %s\", addr)\n\t}\n\treturn nil\n}\n","sourceCodeStart":13,"sourceCodeEnd":40,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/internal/memnet/conn_unix.go#L13-L40","documentation":"dialNamedPipe is a build-tag stub: on non-Windows builds (conn_unix.go) it unconditionally returns this error because named pipes are a Windows-only transport. It fires when Unix code paths attempt an npipe:// dial — i.e. memnet.Dial(ctx, \"npipe\", ...) on Linux/macOS. The npipe address is meaningless there, so the call fails fast instead of attempting a bogus dial.","triggerScenarios":"Running on Linux/macOS and calling memnet.Dial or DialEndpoint with an npipe:// endpoint (e.g. DOCKER_HOST=npipe:////./pipe/docker_engine carried over from a Windows machine or CI matrix).","commonSituations":"Shared .env or CI configs written for Windows devs used on Linux runners; scripts copying DOCKER_HOST values between platforms; cross-platform tools that don't branch on runtime.GOOS before choosing the transport.","solutions":["On Unix, use a Unix socket endpoint: DOCKER_HOST=unix:///var/run/docker.sock.","Branch on runtime.GOOS (or the endpoint scheme appropriate for the platform) before selecting npipe.","Stop sourcing Windows-specific env files in Linux containers/CI.","If you truly need the Windows pipe, run the dial from a Windows host or a Windows container."],"exampleFix":"// before\nconn, err := memnet.DialEndpoint(ctx, \"npipe:////./pipe/docker_engine\") // on Linux\n\n// after\nvar endpoint string\nif runtime.GOOS == \"windows\" {\n    endpoint = \"npipe:////./pipe/docker_engine\"\n} else {\n    endpoint = \"unix:///var/run/docker.sock\"\n}\nconn, err := memnet.DialEndpoint(ctx, endpoint)","handlingStrategy":"validation","validationCode":"if strings.HasPrefix(ep, \"npipe://\") && runtime.GOOS != \"windows\" {\n    return fmt.Errorf(\"npipe endpoint %q requires windows\", ep)\n}","typeGuard":"func isWindowsPipeEndpoint(ep string) bool {\n    return runtime.GOOS == \"windows\" && strings.HasPrefix(ep, \"npipe://\")\n}","tryCatchPattern":"conn, err := memnet.DialEndpoint(ctx, ep)\nif err != nil {\n    if runtime.GOOS != \"windows\" && strings.HasPrefix(ep, \"npipe://\") {\n        err = fmt.Errorf(\"wrong-platform DOCKER_HOST (npipe on %s); use unix:// socket: %w\", runtime.GOOS, err)\n    }\n    return nil, err\n}","preventionTips":["Choose endpoint scheme per runtime.GOOS.","Never share Windows DOCKER_HOST values into Linux CI.","Fail fast on cross-platform config instead of dialing."],"tags":["named-pipe","windows","platform","network","go"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}