{"record":{"id":"6bb85e313e15ea1f","repo":"tailscale/tailscale","slug":"failed-to-send-d-logs","errorCode":null,"errorMessage":"failed to send %d logs","messagePattern":"failed to send (.+?) logs","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ipn/auditlog/auditlog.go","lineNumber":262,"sourceCode":"\t}\n\tif len(pending) == 0 {\n\t\treturn nil\n\t}\n\tif t == nil {\n\t\treturn errors.New(\"no transport\")\n\t}\n\n\tcomplete, unsent := al.sendToTransport(ctx, pending, t)\n\tal.markTransactionsDone(complete)\n\n\tal.mu.Lock()\n\tdefer al.mu.Unlock()\n\tif err = al.appendToStoreLocked(unsent); err != nil {\n\t\tal.logf(\"[unexpected] failed to persist logs: %v\", err)\n\t}\n\n\tif len(unsent) != 0 {\n\t\treturn fmt.Errorf(\"failed to send %d logs\", len(unsent))\n\t}\n\n\tif len(complete) != 0 {\n\t\tal.logf(\"complete %d audit log transactions\", len(complete))\n\t}\n\treturn nil\n}\n\n// sendToTransport sends all pending logs to the control plane. Returns a pair of slices\n// containing the logs that were successfully sent (or failed permanently) and those that were not.\n//\n// This may require multiple round trips to the control plane and can be a long running transaction.\nfunc (al *Logger) sendToTransport(ctx context.Context, pending []*transaction, t Transport) (complete []*transaction, unsent []*transaction) {\n\tfor i, txn := range pending {\n\t\treq := tailcfg.AuditLogRequest{\n\t\t\tAction:    tailcfg.ClientAuditAction(txn.Action),\n\t\t\tDetails:   txn.Details,\n\t\t\tTimestamp: txn.TimeStamp,","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/ipn/auditlog/auditlog.go#L244-L280","documentation":"Raised by Logger.flush when some pending audit logs could not be delivered to the control plane transport. The unsent entries were persisted back to the store for a later retry; the count reports how many remain.","triggerScenarios":"Thrown at ipn/auditlog/auditlog.go:262 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wait for the retry timer; delivery resumes when control is reachable.","Check control-plane connectivity if the count does not decrease."],"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"}