Fix "Failed to check session.lock" error
What the session lock messages mean in each Minecraft version, and how to stop the server cleanly and clear session.lock safely.
Minecraft keeps a small file called session.lock in the world folder so it can tell when something else is using the same world. When that check fails, the server stops with a session lock message. This guide covers what it says in each version, what it means and how to clear it.
Checked against the server files of Minecraft 1.12.2, 1.13.2, 1.14.4, 1.15.2, 1.16.5, 1.20.4, 1.21.11 and 26.3, October 2026.
What the message looks like
The wording, and the meaning, depend on your Minecraft version.
- Minecraft 1.12.2 to 1.15.2 write a time value into
session.lockwhen the world opens, and later read it back. In these versionsFailed to check session lock, abortingmeans the file could not be written or read.The save is being accessed from another location, abortingis a different failure: the value in the file is no longer the one this server wrote, so something else wrote to the file, such as a second server instance using the same world. - Minecraft 1.16.5 and newer take a Java file lock on
session.lockinstead. When something else already holds it, the log line has the path tosession.lockfirst and ends inalready locked (possibly by other Minecraft instance?).
We opened the server jars of 1.12.2, 1.13.2, 1.14.4, 1.15.2 and 1.16.5. The first four contain the two older messages and the last contains the newer one. We found the same file lock in 1.20.4, 1.21.11 and 26.3.
Fix it
- Open the Console tab and click Stop. Wait until the status reads Offline.
- If Stop hangs, click Force stop and confirm. It skips the graceful shutdown, so use it only when Stop does not work.
- Click Start once and wait for the
Doneline.
That often clears it when the lock belonged to a run that had not finished shutting down. If the message comes back:
- Stop the server again, and wait until the status reads Offline.
- Open the File Manager and go into the world folder. Its name is World folder in the Config Editor under World, and
worldby default. - Delete
session.lock. On Minecraft 1.16.5 and newer the game creates the file again at the next start, and we found that in 1.16.5, 1.20.4 and 26.3. On older versions, take a backup first, as in Create and restore backups. - Click Start.
If the world still will not load, or other errors follow, open the Backups tab, click Restore on the last good backup and confirm. The panel says a restore overwrites all current server files and cannot be undone. Fix a Minecraft server that will not start lists the other start-up messages.
Never delete the world folder to get rid of this error. It holds the whole world, and the error is about one small file inside it.
What causes it
On Minecraft 1.16.5 and newer, a Java file lock is held until it is released, the file is closed or the Java process ends. So while an earlier run of the server is still shutting down, a new start cannot take the lock. That is why the steps above wait for the status to read Offline before you click Start.
On 1.12.2 to 1.15.2 there is no file lock. The Failed to check session lock message points at the file itself: the server could not write it or read it back. The accessed from another location message points at something else having written to session.lock while this server ran.
Stop it happening again
- Let Stop finish before you start again, and keep Force stop for when it hangs.
- Stop the server before you upload, replace or delete world files. Upload your singleplayer Minecraft world covers the safe order for a world.
- If you restart on a timer, use a schedule that gives players warning and a clean stop, as in Schedule automatic restarts.
Was this guide helpful?
Related guides
Failed to initialize server: players folder
Minecraft server stops with DETECTED OLD PLAYER DIRECTORY IN THE WORLD SAVE? Move the leftover players folder out of your world, then start it again.
Fix a Minecraft server that will not start
Read the Console for the first real error, match the message to a fix, and undo your last change in the safe order, from add-ons to backups.
Fix No key dimensions in MapLike (level.dat)
We broke level.dat on purpose to test this: rename level.dat_old to get the world back in under a minute, or restore a backup if both are bad.
