{"record":{"id":"d12e4ee6e234a07d","repo":"tailscale/tailscale","slug":"error-sending-request-v","errorCode":null,"errorMessage":"error sending request: %v","messagePattern":"error sending request: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sessionrecording/connect.go","lineNumber":191,"sourceCode":"\t\treturn fmt.Errorf(\"error checking support for `/v2/event` endpoint: %w\", err)\n\t}\n\n\tif !supported {\n\t\treturn EventAPINotSupportedErr{\n\t\t\tap: ap,\n\t\t}\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", fmt.Sprintf(\"http://%s/v2/event\", ap.String()), event)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating request: %w\", err)\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error sending request: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tbody, err := io.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\t// Handle the case where reading the body itself fails\n\t\t\treturn fmt.Errorf(\"server returned non-OK status: %s, and failed to read body: %w\", resp.Status, err)\n\t\t}\n\n\t\treturn fmt.Errorf(\"server returned non-OK status: %d: %s\", resp.StatusCode, string(body))\n\t}\n\n\treturn nil\n}\n\n// connectV1 connects to the legacy /record endpoint on the recorder. It is\n// used for backwards-compatibility with older tsrecorder instances.","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/sessionrecording/connect.go#L173-L209","documentation":"Returned by SendEvent when the HTTP POST of the session event to the tsrecorder /v2/event endpoint fails at transport level: recorder down, unreachable over the tailnet, timeout, or connection reset mid-request.","triggerScenarios":"Thrown at sessionrecording/connect.go:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the tsrecorder node is online and reachable over the tailnet (tailscale ping the recorder addr)","Verify the tsrecorder process is listening on the expected port and inspect its logs","Retry the event send; transient network failures are expected and callers like SSH recording retry the connection","Ensure the local node's outbound connections to the recorder's IP:port are not blocked by ACLs"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6e0912f97994f927632b34ae9e63b53d6516a6ac","analyzedAt":"2026-08-18T08:17:25.280Z","contentChangedAt":"2026-08-18T08:17:25.280Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}