# How to Fix 'Failed to Check Session Lock' on Your Minecraft Server (/docs/minecraft/fix-session-lock)



import { Step, Steps } from 'fumadocs-ui/components/steps';

**"Failed to check session lock, aborting"** means the server tried to acquire exclusive access to a world folder and was refused. Minecraft uses a `session.lock` file to ensure only one server instance writes to a world at a time — and when something goes wrong with that file, the server refuses to start as a safety measure.

What session.lock Does [#what-sessionlock-does]

Every world folder contains a `session.lock` file. When a server starts:

1. It opens `session.lock` and writes a unique value
2. It keeps the file lock open while running
3. On clean shutdown, it releases the lock
4. On the next start, it confirms no other process is holding the lock

If a server is **killed** (power loss, OOM kill, container restart) instead of stopped cleanly, the lock file may be left in a state the next start can't read — triggering this error.

Why It Happens [#why-it-happens]

| Cause                                                 | How common                 |
| ----------------------------------------------------- | -------------------------- |
| **Server killed mid-run** (OOM, exit 137, panel kill) | Most common                |
| **Two server instances on the same world**            | Common with cloned servers |
| **Container restart during file write**               | Sometimes                  |
| **Filesystem corruption**                             | Rare                       |
| **Disk full**                                         | Rare                       |

Fix It [#fix-it]

<Steps>
  <Step>
    Make sure no other server is running on this world [#make-sure-no-other-server-is-running-on-this-world]

    Open the [XGamingServer Panel](https://panel.xgamingserver.com) **Dashboard** and confirm only **one** server is running. If you cloned a server or have multiple instances pointing at the same world, **stop all of them**.

    > **Critical:** Never run two servers on the same world folder. Even briefly. It causes irreversible corruption — chunks get written by both servers and become unreadable.
  </Step>

  <Step>
    Stop the affected server [#stop-the-affected-server]

    In **Console**, click **Stop**. Wait until the Dashboard shows it as fully **Offline**.
  </Step>

  <Step>
    Delete session.lock [#delete-sessionlock]

    Click **Files** in the sidebar. Open the world folder (`world/` by default — or whatever your `level-name` is). Delete the `session.lock` file.

    If you have separate Nether/End folders (Spigot/Paper format), check `world_nether/` and `world_the_end/` too — delete `session.lock` from each.

    > **Safe to delete:** `session.lock` is a runtime lock file. The server recreates it on startup. Deleting it won't affect your world data.
  </Step>

  <Step>
    Start the server [#start-the-server]

    Start from **Console**. The server creates a fresh `session.lock` and boots normally.
  </Step>
</Steps>

If the Error Comes Back [#if-the-error-comes-back]

If `session.lock` errors keep happening on every restart, you have a **deeper issue**:

| Problem                             | Fix                                                                                            |
| ----------------------------------- | ---------------------------------------------------------------------------------------------- |
| Server keeps OOM-killing            | Increase RAM — see [How Much RAM](/docs/minecraft/how-much-ram). Each kill leaves a stale lock |
| Watchdog kills from `max-tick-time` | Find the lag source with [Spark](/docs/minecraft/setup-spark)                                  |
| Two scheduled restarts overlap      | Check **Schedules** for overlapping tasks                                                      |
| World folder corrupted              | Restore from **Backups**, or replace `level.dat` with `level.dat_old`                          |
| Disk full                           | Check the panel storage usage                                                                  |
| Filesystem error on host            | Open a support ticket — host-side fsck may be needed                                           |

Don't Confuse with Other Lock Errors [#dont-confuse-with-other-lock-errors]

| Error message                                | What it actually means                     |
| -------------------------------------------- | ------------------------------------------ |
| `Failed to check session lock`               | This guide                                 |
| `Address already in use`                     | Network port conflict, not file lock       |
| `Cannot lock storage`                        | Same root cause as session lock — same fix |
| `Session lock check failed for world: world` | Same root cause as above                   |

Common Mistakes [#common-mistakes]

| Mistake                                             | Fix                                                 |
| --------------------------------------------------- | --------------------------------------------------- |
| Deleting the **whole world folder**                 | Only delete `session.lock` — never the world itself |
| Deleting `session.lock` while the server is running | Stop the server first                               |
| Ignoring the underlying crash that left the lock    | Find what's killing the JVM and fix that too        |
| Restoring the lock from a backup                    | Don't — backups shouldn't include `session.lock`    |

Related Guides [#related-guides]

* [Server Won't Start](/docs/minecraft/fix-server-wont-start)
* [Java Exit Codes](/docs/minecraft/fix-java-exit-codes)
* [How Much RAM](/docs/minecraft/how-much-ram)
* [Find / Read Crash Reports](/docs/minecraft/find-read-crash-reports)
* [Common Issues](/docs/minecraft/common-issues)
