{"record":{"id":"9c8d77ea3959f72a","repo":"tailscale/tailscale","slug":"failed-to-get-tailnet-lock-log-v","errorCode":null,"errorMessage":"failed to get tailnet lock log: %v","messagePattern":"failed to get tailnet lock log: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"feature/tailnetlock/tailnetlock.go","lineNumber":50,"sourceCode":"\t}\n\n\tlogf := b.Logger()\n\tlogf(\"c2n: %s %s received\", r.Method, r.URL)\n\n\tlimit := defaultC2NLogLimit\n\tlimitStr := r.URL.Query().Get(\"limit\")\n\tif limitStr != \"\" {\n\t\tif parsed, err := strconv.Atoi(limitStr); err == nil {\n\t\t\tlimit = min(parsed, maxC2NLogLimit)\n\t\t}\n\t}\n\n\tupdates, err := b.TailnetLockLog(limit)\n\tif ipnlocal.IsTailnetLockNotActive(err) {\n\t\thttp.Error(w, \"tailnet lock not active\", http.StatusBadRequest)\n\t\treturn\n\t} else if err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"failed to get tailnet lock log: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tresp, err := tslockjsonv1.LogResponse(updates)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"failed to get tailnet lock log: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tjsonv1.NewEncoder(w).Encode(resp)\n}\n","sourceCodeStart":32,"sourceCodeEnd":62,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/feature/tailnetlock/tailnetlock.go#L32-L62","documentation":"handleC2NDebugTKALog serves tailnet lock log entries to the control plane. It fires when TailnetLockLog returns an error other than 'not active', such as a chonk read failure, and responds 500 with the wrapped cause.","triggerScenarios":"Thrown at feature/tailnetlock/tailnetlock.go:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the tailnet lock log store and tailscaled logs; retry after restart."],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}