From 73a0f691ec82ed3ff154bcb1b0351c79b9336446 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 20 Apr 2026 19:40:36 +0200 Subject: [PATCH] fix(license): degrade to free when servers unreachable or key rejected On startup, if the license server was unreachable with no usable cached status, or the server rejected the key, we only logged a warning without clearing persisted license.state. On Redis/keyvalue deployments a previous run's Licensed=true could remain active even though pro features were advertised as unavailable. Route both paths through degradeToFree so the persisted state is cleared. --- pkg/license/license.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/license/license.go b/pkg/license/license.go index a088f01ed..98dd74d9c 100644 --- a/pkg/license/license.go +++ b/pkg/license/license.go @@ -180,10 +180,13 @@ func Init() { log.Fatalf("Could not apply cached license: %s", err) } } else { - log.Warningf("Could not reach any license server and no cached validation exists. Pro features will not be available. Please check your network connectivity.") + // Clear any persisted Licensed=true state from a previous run + // (e.g. via Redis keyvalue) so a now-unreachable server can't + // leave stale entitlements active. + degradeToFree("Could not reach any license server and no cached validation exists. Pro features will not be available.") } case !resp.Valid: - log.Warningf("License key is invalid: %s. Pro features will not be available.", resp.Message) + degradeToFree(fmt.Sprintf("License key is invalid: %s.", resp.Message)) default: applyResponse(resp) if err := cacheResponse(resp); err != nil {