Direct answer
Do not delete `session.lock` while any server process may still be using the world. Stop every instance that points at that world, confirm no duplicate Java/container process is running, take a backup, then start one server instance. Only treat a lock as stale after you have proved the previous process is gone.
What it means
Minecraft uses a session lock to prevent two server processes from writing the same world at once.
If you are a player
- Note the exact world/dimension, coordinates if known, and action that triggers the problem.
- If other players can reproduce it in the same place, tell the owner; location-specific evidence is valuable for world/chunk problems.
- Do not repeatedly force-load a crashing area if the server is unstable. Let the owner make a backup before repair attempts.
If you run the server
Targeted diagnosis: This can indicate that a second server process is trying to open the same world. First inspect running server instances and panel restart loops; never mount the same writable world into two ordinary Minecraft servers.
- Check hosting-panel tasks, Docker containers, systemd services, and manually started Java processes for a duplicate instance.
- Make sure two server directories are not configured to use the same world path.
- After a crash, perform a clean stop/start from the panel before manually touching lock files.
- If the world still reports a lock with no process alive, work on a backup and follow the server software/host recovery guidance.
Fix and verify: Stop every instance accessing that world and ensure the processes have actually exited before trying again. Back up the world; do not blindly delete session.lock while a server may still be writing to it.
References
Use the documentation for the exact software and release you run. These sources support the settings or diagnostic behavior used in this fix.
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.