{"record":{"id":"cc976d961718fc91","repo":"docker/compose","slug":"unsupported-network-s","errorCode":null,"errorMessage":"unsupported network: %s","messagePattern":"unsupported network: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/memnet/conn.go","lineNumber":48,"sourceCode":"\tif addr, ok := strings.CutPrefix(endpoint, \"npipe://\"); ok {\n\t\treturn Dial(ctx, \"npipe\", addr)\n\t}\n\treturn nil, fmt.Errorf(\"unsupported protocol for address: %s\", endpoint)\n}\n\nfunc Dial(ctx context.Context, network, addr string) (net.Conn, error) {\n\tvar d net.Dialer\n\tswitch network {\n\tcase \"unix\":\n\t\tif err := validateSocketPath(addr); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn d.DialContext(ctx, \"unix\", addr)\n\tcase \"npipe\":\n\t\t// N.B. this will return an error on non-Windows\n\t\treturn dialNamedPipe(ctx, addr)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unsupported network: %s\", network)\n\t}\n}\n","sourceCodeStart":30,"sourceCodeEnd":51,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/internal/memnet/conn.go#L30-L51","documentation":"The lower-level memnet.Dial switch only implements the \"unix\" and \"npipe\" networks; any other network string (\"tcp\", \"udp\", an empty string, \"UNIX\" with wrong case) hits the default arm and fails immediately without dialing. This is separate from error 87: DialEndpoint parses the scheme and calls Dial with the canonical network name, so seeing this from DialEndpoint means the scheme matched but was mapped unexpectedly — more often it appears when code calls Dial directly.","triggerScenarios":"Calling memnet.Dial(ctx, network, addr) with network other than exactly \"unix\" or \"npipe\" — e.g. \"tcp\", \"tcp4\", \"\", or a scheme string like \"unix://\" passed as the network argument by mistake.","commonSituations":"Reusing a generic dial helper that passes scheme:// strings where a bare network name is expected; empty network after defaults are applied incorrectly; copied code that assumed net.Dial's accepted networks.","solutions":["Pass one of the two supported network names: Dial(ctx, \"unix\", \"/path/to.sock\") or Dial(ctx, \"npipe\", pipeName) on Windows.","For TCP endpoints, use net.Dialer.DialContext directly — memnet intentionally does not support it.","Centralize the scheme→network mapping in one place (as DialEndpoint does) instead of ad-hoc call sites."],"exampleFix":"// before\nconn, err := memnet.Dial(ctx, \"tcp\", \"127.0.0.1:2375\") // unsupported\n\n// after\nconn, err := (&net.Dialer{}).DialContext(ctx, \"tcp\", \"127.0.0.1:2375\")","handlingStrategy":"validation","validationCode":"switch network {\ncase \"unix\", \"npipe\": // ok\ndefault:\n    return fmt.Errorf(\"memnet supports unix/npipe, got %q\", network)\n}\nconn, err := memnet.Dial(ctx, network, addr)","typeGuard":"func supportedNetwork(n string) bool { return n == \"unix\" || n == \"npipe\" }","tryCatchPattern":"conn, err := memnet.Dial(ctx, network, addr)\nif err != nil {\n    return fmt.Errorf(\"memnet dial %s %s: %w\", network, addr, err)\n}","preventionTips":["Only pass the literal network names 'unix' and 'npipe'.","Keep scheme parsing in DialEndpoint instead of hand-mapping at call sites.","Use net.Dialer for tcp/udp."],"tags":["network","unix-socket","named-pipe","validation","go"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}