{"record":{"id":"c6c827292a1b0957","repo":"zylon-ai/private-gpt","slug":"redis-streaming-dependencies-are-not-installed-in","errorCode":null,"errorMessage":"Redis streaming dependencies are not installed. Install with `uv sync --inexact --extra redis`.","messagePattern":"Redis streaming dependencies are not installed\\. Install with `uv sync --inexact --extra redis`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"private_gpt/components/streaming/registry.py","lineNumber":18,"sourceCode":"from collections.abc import Callable\n\nfrom private_gpt.components.streaming.providers.stream_service import StreamService\nfrom private_gpt.settings.settings import Settings\nfrom private_gpt.utils.dependencies import format_missing_dependency_message\n\nStreamProvider = Callable[[Settings], StreamService]\n\n\ndef _redis_stream_provider(settings: Settings) -> StreamService:\n    try:\n        from private_gpt.components.streaming.providers.redis_stream_service import (\n            LazyRedisClientFactory,\n            RedisStreamConfig,\n            RedisStreamService,\n        )\n    except ImportError as e:\n        raise ImportError(\n            format_missing_dependency_message(\n                \"Redis streaming\",\n                extras=\"redis\",\n            )\n        ) from e\n\n    config = RedisStreamConfig(\n        redis_url=settings.redis.url + \"/8\",\n        stream_prefix=settings.stream.stream_prefix,\n        status_prefix=settings.stream.status_prefix,\n        expiry_seconds=settings.stream.stream_expiration,\n        max_stream_length=settings.stream.maximum_stream_length,\n        minimum_connections=settings.stream.minimum_connections,\n    )\n    client = LazyRedisClientFactory.get_instance(config)\n    return RedisStreamService(config=config, redis_client=client)\n\n","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/streaming/registry.py#L1-L36","documentation":"Raised by the Redis stream provider factory in streaming/registry.py when importing RedisStreamService (which needs the redis client library) fails with ImportError. The dependency is optional and shipped behind the 'redis' extra, so the message tells you the exact uv sync command to install it. The original ImportError is chained via 'from e'.","triggerScenarios":"Configuring settings.stream.broker to the Redis provider in an environment where the redis package was never installed (default install excludes optional extras).","commonSituations":"Enabling Redis streaming in an existing deployment without reinstalling deps; CI images built without --extra redis; a venv synced before the redis support was added to settings.","solutions":["Run: uv sync --inexact --extra redis","Verify the import works afterwards: python -c \"import redis\" (or import the provider module)","If you cannot install extras, switch settings.stream.broker back to the in-memory provider"],"exampleFix":"# before: broker=redis without deps, ImportError at startup\n# terminal\nuv sync --inexact --extra redis\n# then restart the app with stream.broker: redis","handlingStrategy":"validation","validationCode":"try:\n    import redis  # noqa: F401\nexcept ImportError:\n    raise SystemExit(\n        \"stream.broker=redis requires the redis extra: uv sync --inexact --extra redis\"\n    )","typeGuard":"def redis_streaming_available() -> bool:\n    try:\n        import redis  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":null,"preventionTips":["Add a dependency preflight check for optional extras at app startup","Include needed extras in Docker/CI images explicitly (--extra redis)"],"tags":["streaming","redis","dependencies","import","installation"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}