glanceapp/glance · error

renewing session ID: %v

Error message

renewing session ID: %v

What it means

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.

Source

Thrown at internal/glance/widget-dns-stats.go:447

		return nil
	}

	if sessionID == "" {
		if err := fetchNewSessionID(); err != nil {
			slog.Error("Failed to fetch Pihole v6 session ID", "error", err)
			return nil, "", fmt.Errorf("fetching session ID: %v", err)
		}
	} else {
		isValid, err := checkPiholeSessionIDIsValid(instanceURL, client, sessionID)
		if err != nil {
			slog.Error("Failed to check Pihole v6 session ID validity", "error", err)
			return nil, "", fmt.Errorf("checking session ID: %v", err)
		}

		if !isValid {
			if err := fetchNewSessionID(); err != nil {
				slog.Error("Failed to renew Pihole v6 session ID", "error", err)
				return nil, "", fmt.Errorf("renewing session ID: %v", err)
			}
		}
	}

	var wg sync.WaitGroup
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	type statsResponseJson struct {
		Queries struct {
			Total          int     `json:"total"`
			Blocked        int     `json:"blocked"`
			PercentBlocked float64 `json:"percent_blocked"`
		} `json:"queries"`
		Gravity struct {
			DomainsBlocked int `json:"domains_being_blocked"`
		} `json:"gravity"`
	}

View on GitHub (pinned to 91324e8de7)

Solutions

  1. Update the password in the dns-stats widget config if it changed on the Pi-hole side.
  2. Confirm the instance is reachable and healthy, then let the next widget refresh re-auth.
  3. If renewal keeps failing, test auth manually with curl POST /api/auth using the configured password.
Defensive patterns

Strategy: retry

Try / catch

if err != nil && strings.HasPrefix(err.Error(), "renewing session ID") {
    // session expired AND re-auth failed: verify password, then retry next cycle
    slog.Error("pihole session renewal failed — check password", "error", err)
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15). Data as JSON: /api/errors/7dbc76adb669d1d2. Report an issue: GitHub.