MemPalace/mempalace · error · MineAlreadyRunning

palace {resolved} is held by {holder}; wait for it to finish

Error message

palace {resolved} is held by {holder}; wait for it to finish or stop the holder before retrying

What it means

Error "palace {resolved} is held by {holder}; wait for it to finish or stop the holder before retrying" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/palace.py:1354

            fd = os.open(lock_path, os.O_CREAT | os.O_WRONLY, 0o600)
            os.close(fd)
        except FileExistsError:
            pass
    lf = open(lock_path, "r+b")
    acquired = False
    try:
        # Lock byte 0 explicitly. msvcrt.locking is byte-position dependent;
        # fcntl.flock is whole-file but the seek is harmless there.
        lf.seek(0)
        if os.name == "nt":
            import msvcrt

            try:
                msvcrt.locking(lf.fileno(), msvcrt.LK_NBLCK, 1)
                acquired = True
            except OSError as exc:
                holder = _read_lock_holder(lf)
                raise MineAlreadyRunning(
                    f"palace {resolved} is held by {holder}; "
                    "wait for it to finish or stop the holder before retrying"
                ) from exc
        else:
            import fcntl

            try:
                fcntl.flock(lf, fcntl.LOCK_EX | fcntl.LOCK_NB)
                acquired = True
            except BlockingIOError as exc:
                holder = _read_lock_holder(lf)
                raise MineAlreadyRunning(
                    f"palace {resolved} is held by {holder}; "
                    "wait for it to finish or stop the holder before retrying"
                ) from exc
        # Record our own identity for any later contender's diagnostic message.
        _write_lock_holder(lf)
        # Mark the hold from inside the try so it always pairs with

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Wait for the holder to finish or stop it, then retry

When it happens

Trigger: Thrown at mempalace/palace.py:1354 when the library encounters an invalid state.

Common situations: Another process holds the palace lock.


AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15). Data as JSON: /api/errors/cea2b8a867419767. Report an issue: GitHub.