{"record":{"id":"a45abb360ea3ff77","repo":"MemPalace/mempalace","slug":"2","errorCode":"2","errorMessage":"Writable MCP HTTP startup refused: %s","messagePattern":"Writable MCP HTTP startup refused: (.+?)","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"mempalace/mcp_server.py","lineNumber":7992,"sourceCode":"            break\n\n\ndef _run_http_loop() -> None:\n    # In HTTP mode there is no JSON-RPC stdio channel. Keeping the import-time\n    # stdout->stderr guard in place means any accidental print from a dependency\n    # still cannot masquerade as an HTTP response.\n    logger.info(\"MemPalace MCP HTTP server starting...\")\n\n    # A writable HTTP server is a long-lived storage client, so it must own the\n    # local palace before it binds. Refusing at startup avoids advertising a\n    # writable service that will only fail (or race) on its first mutation.\n    # Explicit read-only HTTP remains safe to run beside the one writer owner.\n    owns_writer_lease = False\n    if not _READ_ONLY:\n        writer_ok, writer_reason = _acquire_mcp_writer_lock()\n        if not writer_ok:\n            logger.error(\"Writable MCP HTTP startup refused: %s\", writer_reason)\n            raise SystemExit(2)\n        owns_writer_lease = True\n\n    try:\n        # The HTTP transport exists for long-lived deployments. Do the cheap\n        # filesystem-only probe before binding, but never make the listener wait on\n        # optional embedder/HNSW warmup. Operators and tests should see /healthz as\n        # soon as the process is alive.\n        _refresh_vector_disabled_flag()\n        _start_idle_exit_watchdog()\n        _start_write_stall_watchdog()\n\n        raw_warmup = os.environ.get(\"MEMPALACE_EAGER_WARMUP\", \"\").strip().lower()\n        if raw_warmup in _WARMUP_TRUTHY:\n\n            def _warmup_with_lock():\n                with _HTTP_REQUEST_LOCK:\n                    _maybe_eager_warmup_embedder()\n","sourceCodeStart":7974,"sourceCodeEnd":8010,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/mcp_server.py#L7974-L8010","documentation":"Error \"Writable MCP HTTP startup refused: %s\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/mcp_server.py:7992 when the library encounters an invalid state.","commonSituations":"Another writable MCP/direct/daemon owner already holds the local backend.","solutions":["Stop the existing writable owner, or route writes through it"],"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"}