// troubleshooting guide · gitea

Gitea Upgrade Failed or Database Is Locked

Status
Workaround available
platforms:
Self-hosted, Docker, TrueNAS, Unraid
updated:
November 16, 2026
reports:
3
Method
how we research
Share

RUNBOOK · gitea/upgrade-failed-database-locked4 FIXES

// quick answer

Back up, run gitea doctor, and move off SQLite if you see database is locked. Check that environment variables are not overriding app.ini.

Most likely fix: Back up first

How to fix it

// try these in order, the most common fix is first

  1. FIX 1Back up first

    1. 01Run gitea dump
    2. 02Copy app.ini and the database
    Did this fix it?
  2. FIX 2Run doctor

    1. 01Run gitea doctor check --all --fix before and after upgrading
    Did this fix it?
  3. FIX 3Move off SQLite

    1. 01Maintainers advise MySQL or PostgreSQL for database is locked errors
    2. 02Migrate the data and update [database] in app.ini
    Did this fix it?
  4. FIX 4Check env overrides

    1. 01Look for GITEA__database__* variables in your container, which override app.ini
    Did this fix it?

SANDBOX · gitea RUNS IN YOUR BROWSER

Try it: push, review, run CI and merge in a code host and cloud workspace

A hands-on Gitea-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.

Symptoms

Gitea fails to start after upgrade, shows version errors, or logs database is locked.

Why it happens

  • C-01Failed database migration
  • C-02SQLite concurrency limits
  • C-03GITEA__ environment variables overriding app.ini
  • C-04Skipping backups

// this guide also covers

  • gitea upgrade failed
  • gitea database is locked
  • gitea fails to start after update

Still not working?

If Gitea keeps failing, you're not alone. See every Gitea problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us

Watch Gitea Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All plan limits, paywalls & watermarks guides →

Other Gitea errors

All 11 Gitea errors and fixes →