{"record":{"id":"065af1c6913e878e","repo":"hashicorp/nomad","slug":"unsupported-transport","errorCode":null,"errorMessage":"unsupported transport","messagePattern":"unsupported transport","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/api.go","lineNumber":957,"sourceCode":"\tr, err := c.newRequest(\"GET\", endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr.setQueryOptions(q)\n\t_, resp, err := requireOK(c.doRequest(r)) //nolint:bodyclose // Closing the body is the caller's responsibility.\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.Body, nil\n}\n\n// websocket makes a websocket request to the specific endpoint\nfunc (c *Client) websocket(endpoint string, q *QueryOptions) (*websocket.Conn, *http.Response, error) {\n\n\ttransport, ok := c.httpClient.Transport.(*http.Transport)\n\tif !ok {\n\t\treturn nil, nil, errors.New(\"unsupported transport\")\n\t}\n\tdialer := websocket.Dialer{\n\t\tReadBufferSize:   4096,\n\t\tWriteBufferSize:  4096,\n\t\tHandshakeTimeout: c.httpClient.Timeout,\n\n\t\t// values to inherit from http client configuration\n\t\tNetDial:         transport.Dial,\n\t\tNetDialContext:  transport.DialContext,\n\t\tProxy:           transport.Proxy,\n\t\tTLSClientConfig: transport.TLSClientConfig,\n\t}\n\n\t// build request object for header and parameters\n\tr, err := c.newRequest(\"GET\", endpoint)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}","sourceCodeStart":939,"sourceCodeEnd":975,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/api/api.go#L939-L975","documentation":"Returned by Client.websocket when the underlying HTTP client's Transport is not an *http.Transport. The websocket dialer needs concrete access to the transport's dial settings; custom or wrapped transport implementations cannot be introspected, so the request is aborted.","triggerScenarios":"Thrown at api/api.go:957 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a *http.Transport (or api.DefaultConfig's client) instead of a custom RoundTripper wrapper for clients that need websocket endpoints (exec, logs)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}