{"record":{"id":"f4bf1a875991f914","repo":"juanfont/headscale","slug":"looking-up-user-w","errorCode":null,"errorMessage":"looking up user: %w","messagePattern":"looking up user: %w","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"hscontrol/oidc.go","lineNumber":827,"sourceCode":"\t\treturn\n\t}\n\n\tpending := authReq.PendingConfirmation()\n\tif pending == nil {\n\t\thttpUserError(writer, NewHTTPError(http.StatusForbidden, \"registration not OIDC-authorized\", nil))\n\n\t\treturn\n\t}\n\n\tif pending.CSRF != cookie.Value {\n\t\thttpUserError(writer, NewHTTPError(http.StatusForbidden, \"csrf token does not match cached registration\", nil))\n\n\t\treturn\n\t}\n\n\tuser, err := a.h.state.GetUserByID(types.UserID(pending.UserID))\n\tif err != nil {\n\t\thttpUserError(writer, fmt.Errorf(\"looking up user: %w\", err))\n\n\t\treturn\n\t}\n\n\tnewNode, err := a.handleRegistration(user, authID, pending.NodeExpiry)\n\tif err != nil {\n\t\tif errors.Is(err, db.ErrNodeNotFoundRegistrationCache) {\n\t\t\thttpUserError(writer, NewHTTPError(http.StatusGone, \"registration session expired\", err))\n\n\t\t\treturn\n\t\t}\n\n\t\thttpUserError(writer, err)\n\n\t\treturn\n\t}\n\n\t// Clear the CSRF cookie now that the registration is final.","sourceCodeStart":809,"sourceCodeEnd":845,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/oidc.go#L809-L845","documentation":"Error \"looking up user: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/oidc.go:827 when the library encounters an invalid state.","commonSituations":"The database lookup of the OIDC-authenticated user failed. Check database connectivity and server logs for the underlying error.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (looking up user); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (looking up user); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}