bytedance/deer-flow · error · MemoryStorageCorruption

Failed to load global memory JSON {path}: {exc}

Error message

Failed to load global memory JSON {path}: {exc}

What it means

Error "Failed to load global memory JSON {path}: {exc}" thrown in bytedance/deer-flow.

Source

Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py:653

                    notifications_by_agent.append((agent_name, notifications))
        if agent_name == DEFAULT_AGENT_BUCKET:
            _, notifications = self._migrate_previous_default_bucket_locked(path, user_id=user_id)
            if notifications:
                notifications_by_agent.append((DEFAULT_AGENT_BUCKET, notifications))
        return notifications_by_agent

    @staticmethod
    def _migration_equivalent(left: dict[str, Any], right: dict[str, Any]) -> bool:
        ignored = {"revision", "createdAt", "updatedAt", "scope", "title", "schemaVersion"}
        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}

    def _load_memory_file(self, path: Path) -> dict[str, Any] | None:
        if not path.exists():
            return None
        try:
            value = json.loads(path.read_text(encoding="utf-8"))
        except (json.JSONDecodeError, OSError, UnicodeError) as exc:
            raise MemoryStorageCorruption(f"Failed to load global memory JSON {path}: {exc}") from exc
        if not isinstance(value, dict):
            raise MemoryStorageCorruption(f"Global memory JSON {path} is not an object")
        return value

    def _recover_if_needed(self, path: Path) -> None:
        """Recover or clean a previously journaled multi-file operation.

        Callers hold the scope's in-process and cross-process locks.
        """
        journal_path = path.parent / ".memory.journal.json"
        if not journal_path.exists():
            return
        try:
            journal = json.loads(journal_path.read_text(encoding="utf-8"))
            operation_id = str(journal["operationId"])
            if not operation_id or Path(operation_id).name != operation_id:
                raise TypeError("operationId must be a plain path component")
            state = journal.get("state")

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Fix or restore the global memory JSON file from a backup; the parse error is named in the exception.
  2. Delete the corrupted file to start with empty global memory if no backup exists.

When it happens

Trigger: Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py:653 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/9516235b07c18d6c. Report an issue: GitHub.