{"record":{"id":"55b74839842d47df","repo":"juanfont/headscale","slug":"initializing-ip-allocator-w","errorCode":null,"errorMessage":"initializing IP allocator: %w","messagePattern":"initializing IP allocator: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hscontrol/state/state.go","lineNumber":233,"sourceCode":"\t\tcacheMaxEntries = cfg.Tuning.RegisterCacheMaxEntries\n\t}\n\n\tauthCache := expirable.NewLRU[types.AuthID, *types.AuthRequest](\n\t\tcacheMaxEntries,\n\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","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/state/state.go#L215-L251","documentation":"Error \"initializing IP allocator: %w\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/state/state.go:233 when the library encounters an invalid state.","commonSituations":"Initializing the IP allocator failed. Verify configured prefixes are valid and do not overlap, and the database IP table is readable.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (initializing IP allocator); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (initializing IP allocator); 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"}