{"record":{"id":"7dbc76adb669d1d2","repo":"glanceapp/glance","slug":"renewing-session-id-v","errorCode":null,"errorMessage":"renewing session ID: %v","messagePattern":"renewing session ID: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-dns-stats.go","lineNumber":447,"sourceCode":"\t\treturn nil\n\t}\n\n\tif sessionID == \"\" {\n\t\tif err := fetchNewSessionID(); err != nil {\n\t\t\tslog.Error(\"Failed to fetch Pihole v6 session ID\", \"error\", err)\n\t\t\treturn nil, \"\", fmt.Errorf(\"fetching session ID: %v\", err)\n\t\t}\n\t} else {\n\t\tisValid, err := checkPiholeSessionIDIsValid(instanceURL, client, sessionID)\n\t\tif err != nil {\n\t\t\tslog.Error(\"Failed to check Pihole v6 session ID validity\", \"error\", err)\n\t\t\treturn nil, \"\", fmt.Errorf(\"checking session ID: %v\", err)\n\t\t}\n\n\t\tif !isValid {\n\t\t\tif err := fetchNewSessionID(); err != nil {\n\t\t\t\tslog.Error(\"Failed to renew Pihole v6 session ID\", \"error\", err)\n\t\t\t\treturn nil, \"\", fmt.Errorf(\"renewing session ID: %v\", err)\n\t\t\t}\n\t\t}\n\t}\n\n\tvar wg sync.WaitGroup\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\ttype statsResponseJson struct {\n\t\tQueries struct {\n\t\t\tTotal          int     `json:\"total\"`\n\t\t\tBlocked        int     `json:\"blocked\"`\n\t\t\tPercentBlocked float64 `json:\"percent_blocked\"`\n\t\t} `json:\"queries\"`\n\t\tGravity struct {\n\t\t\tDomainsBlocked int `json:\"domains_being_blocked\"`\n\t\t} `json:\"gravity\"`\n\t}","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-dns-stats.go#L429-L465","documentation":"Returned by the Pi-hole v6 stats fetcher when the cached session ID was found invalid and the re-authentication (fetchPiholeSessionID via fetchNewSessionID) also failed. This means the session expired (normal over time) AND renewing it errored — typically wrong password or unreachable instance.","triggerScenarios":"checkPiholeSessionIDIsValid returns isValid=false, then POST /api/auth fails with a transport error or non-200 (e.g. incorrect password after a Pi-hole password change).","commonSituations":"Pi-hole password rotated but glance config still has the old one; Pi-hole upgraded and sessions reset; instance briefly offline exactly when renewal was attempted.","solutions":["Update the password in the dns-stats widget config if it changed on the Pi-hole side.","Confirm the instance is reachable and healthy, then let the next widget refresh re-auth.","If renewal keeps failing, test auth manually with curl POST /api/auth using the configured password."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.HasPrefix(err.Error(), \"renewing session ID\") {\n    // session expired AND re-auth failed: verify password, then retry next cycle\n    slog.Error(\"pihole session renewal failed — check password\", \"error\", err)\n}","preventionTips":["Rotate the glance config password whenever the Pi-hole password changes.","Alert on repeated renewal failures — it almost always means stale credentials.","Test auth with curl after any Pi-hole upgrade."],"tags":["network","auth","pihole","session","dns-stats"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}