{"record":{"id":"3675446c0eac94f5","repo":"Devolutions/UniGetUI","slug":"the-unix-socket-path-is-not-available-for-the-name","errorCode":null,"errorMessage":"The Unix socket path is not available for the named-pipe transport.","messagePattern":"The Unix socket path is not available for the named-pipe transport\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcClient.cs","lineNumber":1327,"sourceCode":"            var handler = new SocketsHttpHandler\n            {\n                UseProxy = false,\n                ConnectCallback = async (_, cancellationToken) =>\n                {\n                    if (OperatingSystem.IsWindows())\n                    {\n                        var pipeClient = new NamedPipeClientStream(\n                            \".\",\n                            options.NamedPipeName,\n                            PipeDirection.InOut,\n                            PipeOptions.Asynchronous\n                        );\n                        await pipeClient.ConnectAsync(cancellationToken);\n                        return pipeClient;\n                    }\n\n                    string socketPath = options.NamedPipePath\n                        ?? throw new InvalidOperationException(\n                            \"The Unix socket path is not available for the named-pipe transport.\"\n                        );\n                    var socket = new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.Unspecified);\n                    await socket.ConnectAsync(\n                        new UnixDomainSocketEndPoint(socketPath),\n                        cancellationToken\n                    );\n                    return new NetworkStream(socket, ownsSocket: true);\n                },\n            };\n\n            return new HttpClient(handler)\n            {\n                BaseAddress = options.BaseAddress,\n                Timeout = Timeout.InfiniteTimeSpan,\n            };\n        }\n","sourceCodeStart":1309,"sourceCodeEnd":1345,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcClient.cs#L1309-L1345","documentation":"Thrown in CreateHttpClient's named-pipe ConnectCallback when the transport is NamedPipe, the OS is not Windows, and options.NamedPipePath is null. On Windows the callback uses a NamedPipeClientStream by name; on Unix it needs a Unix domain socket file path, and without one it cannot connect.","triggerScenarios":"Constructing an IpcClient with IpcTransportKind.NamedPipe on Linux/macOS without supplying NamedPipePath in IpcTransportOptions. This is a transport-configuration mismatch: named-pipe transport on Unix requires the socket file location.","commonSituations":"Cross-platform code that hardcodes the named-pipe transport assuming Windows semantics. A persisted endpoint registration from Windows being reused on a Unix host. Forgetting to populate NamedPipePath when building options manually.","solutions":["On Unix, set IpcTransportOptions.NamedPipePath to the Unix socket file path the UniGetUI server listens on.","Prefer the TCP transport (BaseAddress) on non-Windows platforms instead of named pipes.","Obtain transport options from the live endpoint registration rather than constructing them by hand, so the socket path is populated correctly."],"exampleFix":"// before\nvar opts = new IpcTransportOptions { TransportKind = IpcTransportKind.NamedPipe, NamedPipeName = \"unigetui\" };\n// after (on Linux/macOS)\nvar opts = new IpcTransportOptions { TransportKind = IpcTransportKind.NamedPipe, NamedPipeName = \"unigetui\", NamedPipePath = \"/run/unigetui/ipc.sock\" };","handlingStrategy":"validation","validationCode":"static bool TransportOptionsAreSound(IpcTransportOptions o)\n{\n    if (o.TransportKind != IpcTransportKind.NamedPipe) return true;\n    return OperatingSystem.IsWindows() || !string.IsNullOrWhiteSpace(o.NamedPipePath);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On Unix, prefer the TCP transport unless you explicitly manage a socket path.","Always source transport options from a live endpoint registration rather than hand-building them.","Unit-test option construction on all target platforms."],"tags":["ipc","client","transport","named-pipe","unix","configuration"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}