{"record":{"id":"cea2b8a867419767","repo":"MemPalace/mempalace","slug":"palace-resolved-is-held-by-holder-wait-for-it","errorCode":null,"errorMessage":"palace {resolved} is held by {holder}; wait for it to finish or stop the holder before retrying","messagePattern":"palace (.+?) is held by (.+?); wait for it to finish or stop the holder before retrying","errorType":"exception","errorClass":"MineAlreadyRunning","httpStatus":null,"severity":"error","filePath":"mempalace/palace.py","lineNumber":1354,"sourceCode":"            fd = os.open(lock_path, os.O_CREAT | os.O_WRONLY, 0o600)\n            os.close(fd)\n        except FileExistsError:\n            pass\n    lf = open(lock_path, \"r+b\")\n    acquired = False\n    try:\n        # Lock byte 0 explicitly. msvcrt.locking is byte-position dependent;\n        # fcntl.flock is whole-file but the seek is harmless there.\n        lf.seek(0)\n        if os.name == \"nt\":\n            import msvcrt\n\n            try:\n                msvcrt.locking(lf.fileno(), msvcrt.LK_NBLCK, 1)\n                acquired = True\n            except OSError as exc:\n                holder = _read_lock_holder(lf)\n                raise MineAlreadyRunning(\n                    f\"palace {resolved} is held by {holder}; \"\n                    \"wait for it to finish or stop the holder before retrying\"\n                ) from exc\n        else:\n            import fcntl\n\n            try:\n                fcntl.flock(lf, fcntl.LOCK_EX | fcntl.LOCK_NB)\n                acquired = True\n            except BlockingIOError as exc:\n                holder = _read_lock_holder(lf)\n                raise MineAlreadyRunning(\n                    f\"palace {resolved} is held by {holder}; \"\n                    \"wait for it to finish or stop the holder before retrying\"\n                ) from exc\n        # Record our own identity for any later contender's diagnostic message.\n        _write_lock_holder(lf)\n        # Mark the hold from inside the try so it always pairs with","sourceCodeStart":1336,"sourceCodeEnd":1372,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/palace.py#L1336-L1372","documentation":"Error \"palace {resolved} is held by {holder}; wait for it to finish or stop the holder before retrying\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/palace.py:1354 when the library encounters an invalid state.","commonSituations":"Another process holds the palace lock.","solutions":["Wait for the holder to finish or stop it, then retry"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}