{"record":{"id":"9516235b07c18d6c","repo":"bytedance/deer-flow","slug":"failed-to-load-global-memory-json-path-exc","errorCode":null,"errorMessage":"Failed to load global memory JSON {path}: {exc}","messagePattern":"Failed to load global memory JSON (.+?): (.+?)","errorType":"exception","errorClass":"MemoryStorageCorruption","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py","lineNumber":653,"sourceCode":"                    notifications_by_agent.append((agent_name, notifications))\n        if agent_name == DEFAULT_AGENT_BUCKET:\n            _, notifications = self._migrate_previous_default_bucket_locked(path, user_id=user_id)\n            if notifications:\n                notifications_by_agent.append((DEFAULT_AGENT_BUCKET, notifications))\n        return notifications_by_agent\n\n    @staticmethod\n    def _migration_equivalent(left: dict[str, Any], right: dict[str, Any]) -> bool:\n        ignored = {\"revision\", \"createdAt\", \"updatedAt\", \"scope\", \"title\", \"schemaVersion\"}\n        return {key: value for key, value in left.items() if key not in ignored} == {key: value for key, value in right.items() if key not in ignored}\n\n    def _load_memory_file(self, path: Path) -> dict[str, Any] | None:\n        if not path.exists():\n            return None\n        try:\n            value = json.loads(path.read_text(encoding=\"utf-8\"))\n        except (json.JSONDecodeError, OSError, UnicodeError) as exc:\n            raise MemoryStorageCorruption(f\"Failed to load global memory JSON {path}: {exc}\") from exc\n        if not isinstance(value, dict):\n            raise MemoryStorageCorruption(f\"Global memory JSON {path} is not an object\")\n        return value\n\n    def _recover_if_needed(self, path: Path) -> None:\n        \"\"\"Recover or clean a previously journaled multi-file operation.\n\n        Callers hold the scope's in-process and cross-process locks.\n        \"\"\"\n        journal_path = path.parent / \".memory.journal.json\"\n        if not journal_path.exists():\n            return\n        try:\n            journal = json.loads(journal_path.read_text(encoding=\"utf-8\"))\n            operation_id = str(journal[\"operationId\"])\n            if not operation_id or Path(operation_id).name != operation_id:\n                raise TypeError(\"operationId must be a plain path component\")\n            state = journal.get(\"state\")","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py#L635-L671","documentation":"Error \"Failed to load global memory JSON {path}: {exc}\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py:653 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or restore the global memory JSON file from a backup; the parse error is named in the exception.","Delete the corrupted file to start with empty global memory if no backup exists."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}