configure_gitea crash loop when admin user has been renamed via the UI #1519

Open
opened 2026-03-31 12:55:09 +00:00 by zugao · 0 comments

Bug description

When the initial admin user created by the Helm chart is renamed via the Forgejo UI settings, the configure_gitea init container crashes on the next pod restart, causing a Init:Error loop that requires manual database intervention to recover.

Steps to reproduce

  1. Deploy a Forgejo instance using this Helm chart
  2. Log in as the initial admin user (e.g. forgejo_admin)
  3. Go to Settings → Account and rename the account to any other name (e.g. pippo)
  4. Restart the pod
  5. The pod enters Init:Error and never starts

Error

The init container log shows:

  No admin user 'forgejo_admin' found. Creating now...
  Error: user already exists [name: ]

The create fails because user ID 1 already exists in the database under the new name. The script does not know this, so it treats the situation as a missing admin and attempts a creation that is guaranteed to fail.

### Bug description When the initial admin user created by the Helm chart is renamed via the Forgejo UI settings, the `configure_gitea` init container crashes on the next pod restart, causing a `Init:Error `loop that requires manual database intervention to recover. ### Steps to reproduce 1. Deploy a Forgejo instance using this Helm chart 2. Log in as the initial admin user (e.g. forgejo_admin) 3. Go to Settings → Account and rename the account to any other name (e.g. pippo) 4. Restart the pod 5. The pod enters Init:Error and never starts ### Error The init container log shows: ``` No admin user 'forgejo_admin' found. Creating now... Error: user already exists [name: ] ``` The create fails because user ID 1 already exists in the database under the new name. The script does not know this, so it treats the situation as a missing admin and attempts a creation that is guaranteed to fail.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
forgejo-helm/forgejo-helm#1519
No description provided.