{"record":{"id":"635f1855675dc684","repo":"crewAIInc/crewAI","slug":"redis-url-environment-variable-is-not-set","errorCode":null,"errorMessage":"REDIS_URL environment variable is not set","messagePattern":"REDIS_URL environment variable is not set","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-core/src/crewai_core/lock_store.py","lineNumber":75,"sourceCode":"def _redis_available() -> bool:\n    \"\"\"Return True if redis is installed and REDIS_URL is set.\"\"\"\n    if not _REDIS_URL:\n        return False\n    try:\n        import redis  # noqa: F401\n\n        return True\n    except ImportError:\n        return False\n\n\n@lru_cache(maxsize=1)\ndef _redis_connection() -> redis.Redis[bytes]:\n    \"\"\"Return a cached Redis connection, creating one on first call.\"\"\"\n    from redis import Redis\n\n    if _REDIS_URL is None:\n        raise ValueError(\"REDIS_URL environment variable is not set\")\n    return Redis.from_url(_REDIS_URL)\n\n\n@contextmanager\ndef lock(name: str, *, timeout: float = _DEFAULT_TIMEOUT) -> Iterator[None]:\n    \"\"\"Acquire a named lock, yielding while it is held.\n\n    Args:\n        name: A human-readable lock name (e.g. ``\"chromadb_init\"``). The\n              built-in default namespaces it to avoid collisions; a custom\n              backend receives it verbatim.\n        timeout: Maximum seconds to wait for the lock before raising.\n    \"\"\"\n    # Snapshot the global once: a concurrent set_lock_backend() must not turn\n    # the check-then-call into calling ``None``.\n    backend = _backend\n    if backend is not None:\n        with backend(name, timeout=timeout):","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-core/src/crewai_core/lock_store.py#L57-L93","documentation":"Error \"REDIS_URL environment variable is not set\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai-core/src/crewai_core/lock_store.py:75 when the library encounters an invalid state.","commonSituations":"Occurs when initializing the Redis-backed lock store without the REDIS_URL environment variable set. Export REDIS_URL pointing to a reachable Redis instance.","solutions":["Set the REDIS_URL environment variable to your Redis connection string.","Install and run Redis locally, then set REDIS_URL=redis://localhost:6379."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}