{"record":{"id":"9ac55bc8ad5c3213","repo":"juanfont/headscale","slug":"loading-nodes-w-9ac55b","errorCode":null,"errorMessage":"loading nodes: %w","messagePattern":"loading nodes: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hscontrol/state/state.go","lineNumber":238,"sourceCode":"\t\tfunc(id types.AuthID, rn *types.AuthRequest) {\n\t\t\trn.FinishAuth(types.AuthVerdict{Err: ErrRegistrationExpired})\n\t\t},\n\t\tcacheExpiration,\n\t)\n\n\tdb, err := hsdb.NewHeadscaleDatabase(cfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"initializing database: %w\", err)\n\t}\n\n\tipAlloc, err := hsdb.NewIPAllocator(db, cfg.PrefixV4, cfg.PrefixV6, cfg.IPAllocation)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"initializing IP allocator: %w\", err)\n\t}\n\n\tnodes, err := db.ListNodes()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"loading nodes: %w\", err)\n\t}\n\n\t// On startup, all nodes should be marked as offline until they reconnect\n\t// This ensures we don't have stale online status from previous runs\n\tfor _, node := range nodes {\n\t\tnode.IsOnline = new(false)\n\t}\n\n\tusers, err := db.ListUsers(nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"loading users: %w\", err)\n\t}\n\n\tpol, err := hsdb.PolicyBytes(db.DB, cfg)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"loading policy: %w\", err)\n\t}\n","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/state/state.go#L220-L256","documentation":"Error \"loading nodes: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/state/state.go:238 when the library encounters an invalid state.","commonSituations":"Loading nodes from the database at startup failed. Check database integrity and logs for the underlying query error.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (loading nodes); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (loading nodes); 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-15T22:17:37.221Z"}