forgejo session provider is memory, wipes on every pod rollout #127
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Forgejo logs Kai out multiple times per day (4× on 2026-05-25). Sessions don't persist across pod recreations.
Root cause
[session]block in the liveapp.inihas noPROVIDERset, so Forgejo falls back to thememoryprovider. Sessions live only in the pod's RAM. With 7 ReplicaSets in 20 days (image bumps + config churn — current pod is 23h old, replaced by a fresh RS), every rollout wipes all active sessions. ThePROVIDER_CONFIG = /var/lib/gitea/data/sessionspath is a file-provider artifact doing nothing while the provider is memory.Fix
Add to
deploy/forgejo.ymlcontainer env:Postgres is already wired up via
forgejo-db. The DB pod has restarted 8 times in 20 days, last 7d ago — much stabler than memory.SESSION_LIFE_TIME=604800is 7 days.Verification
After rollout, exec into the pod, confirm
app.inishowsPROVIDER = db, and confirm thesessiontable exists in postgres. Then leave a tab open across a manualkubectl rollout restart deploy/forgejo -n forgejoand confirm the session survives.