{"record":{"id":"cb641f442e0f7c0f","repo":"langchain-ai/langgraph","slug":"key-redis-key-does-not-start-with-prefix-prefix","errorCode":null,"errorMessage":"Key {redis_key} does not start with prefix {prefix}","messagePattern":"Key (.+?) does not start with prefix (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/checkpoint/langgraph/cache/redis/__init__.py","lineNumber":39,"sourceCode":"\n        Args:\n            redis: Redis client instance (sync or async)\n            serde: Serializer to use for values\n            prefix: Key prefix for all cached values\n        \"\"\"\n        super().__init__(serde=serde)\n        self.redis = redis\n        self.prefix = prefix\n\n    def _make_key(self, ns: Namespace, key: str) -> str:\n        \"\"\"Create a Redis key from namespace and key.\"\"\"\n        ns_str = \":\".join(ns) if ns else \"\"\n        return f\"{self.prefix}{ns_str}:{key}\" if ns_str else f\"{self.prefix}{key}\"\n\n    def _parse_key(self, redis_key: str) -> tuple[Namespace, str]:\n        \"\"\"Parse a Redis key back to namespace and key.\"\"\"\n        if not redis_key.startswith(self.prefix):\n            raise ValueError(\n                f\"Key {redis_key} does not start with prefix {self.prefix}\"\n            )\n\n        remaining = redis_key[len(self.prefix) :]\n        if \":\" in remaining:\n            parts = remaining.split(\":\")\n            key = parts[-1]\n            ns_parts = parts[:-1]\n            return (tuple(ns_parts), key)\n        else:\n            return (tuple(), remaining)\n\n    def get(self, keys: Sequence[FullKey]) -> dict[FullKey, ValueT]:\n        \"\"\"Get the cached values for the given keys.\"\"\"\n        if not keys:\n            return {}\n\n        # Build Redis keys","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/checkpoint/langgraph/cache/redis/__init__.py#L21-L57","documentation":"Error \"Key {redis_key} does not start with prefix {prefix}\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/checkpoint/langgraph/cache/redis/__init__.py:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}