Direct answer
First identify the database engine and exact error. With SQLite, database is locked often means another connection has an active write transaction; only one SQLite connection may write at once. Preserve the database before investigating process duplication or plugin write contention.
What it means
SQLite file locking is different from a remote MySQL/MariaDB connection failure. A lock can be caused by overlapping writes, a long-running transaction or separate processes using the same SQLite file. It does not automatically mean corruption.
If you are a player
- Report the broken plugin feature, error text and approximate time to staff. Avoid repeated actions that create additional writes.
If you run the server
- Inspect the first stack trace and plugin configuration. Verify whether the database is SQLite (
.dbfile) or a remote database service; use the matching diagnosis. - Back up the database and any SQLite journal/WAL companion files while the server is cleanly stopped. Do not remove
-walor-shmfiles by guesswork. - Check for two running server instances or another tool simultaneously writing the same database. Stop the duplicate writer rather than attempting unsafe file unlocks.
- If one application generates frequent write contention, consult its documentation for supported connection pool, transaction handling or busy-timeout settings. Only tune settings that plugin actually exposes.
- Restart a single server instance, monitor the database log, and confirm expected data remains present.
# Linux: check for duplicate Minecraft Java processes
ps -eo user,pid,args | grep "[j]ava"
# Identify database and related files without changing them:
ls -lah plugins/ExamplePlugin/Never delete the database to “fix” a lock. A busy-timeout is not a cure for a hung connection or repeatedly failing transactions.
References
Use the documentation for the exact software and release you run. These sources support the settings or diagnostic behavior used in this fix.
- PaperMC: Using databases
- PaperMC: Basic troubleshooting
- SQLite FAQ on concurrent access
- SQLite file-locking behavior
Related fixes and guides
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.