{"record":{"id":"db5bed622285f9df","repo":"nautechsystems/nautilus_trader","slug":"redis-version-not-available","errorCode":null,"errorMessage":"Redis version not available","messagePattern":"Redis version not available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/infrastructure/src/redis/mod.rs","lineNumber":257,"sourceCode":"    if config.use_instance_id {\n        write!(stream_key, \"{instance_id}\").expect(\"writing to String cannot fail\");\n        stream_key.push(REDIS_DELIMITER);\n    }\n\n    stream_key.push_str(&config.streams_prefix);\n    stream_key\n}\n\nasync fn get_redis_version(conn: &mut redis::aio::ConnectionManager) -> anyhow::Result<SemVer> {\n    let info: String = redis::cmd(\"INFO\").query_async(conn).await?;\n    let Some(version_str) = info.lines().find_map(|line| {\n        if line.starts_with(\"redis_version:\") {\n            line.split(':').nth(1).map(|s| s.trim().to_string())\n        } else {\n            None\n        }\n    }) else {\n        anyhow::bail!(\"Redis version not available\");\n    };\n\n    SemVer::parse(&version_str)\n}\n\n#[cfg(test)]\nmod tests {\n    use rstest::rstest;\n    use serde_json::json;\n\n    use super::*;\n    use crate::redis::cache::RedisCacheConfig;\n\n    #[rstest]\n    fn test_get_redis_url_default_values() {\n        let config: RedisCacheConfig = serde_json::from_value(json!({})).unwrap();\n        let (url, redacted_url) = get_redis_url(&config);\n        assert_eq!(url, \"redis://127.0.0.1:6379\");","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/infrastructure/src/redis/mod.rs#L239-L275","documentation":"get_redis_version queries Redis via INFO (looking for a `redis_version:` line) and parses it into a SemVer. If no INFO line starts with `redis_version:` the bailing if-let reports the version is unavailable, because the parser cannot proceed without it. The library needs the version to gate compatibility checks for the Redis connection.","triggerScenarios":"Connecting via create_redis_connection when the server's INFO output contains no `redis_version:` line — e.g. connecting to a Redis-compatible proxy (KeyDB variants, Twemproxy, some managed gateways) that strips the INFO payload, or a non-Redis server on the endpoint.","commonSituations":"Pointing the client at a proxy/load balancer instead of a real Redis node; using managed services with sanitized INFO responses; misconfigured connection strings hitting an unrelated service on the Redis port.","solutions":["Connect directly to a real Redis server whose INFO command returns the standard `redis_version:` field","Check what the endpoint returns with redis-cli: run `redis-cli INFO server | grep redis_version` to verify the field exists","If behind a proxy, bypass it for the version probe or upgrade to a proxy that forwards full INFO output","Log the full INFO response to confirm the payload shape the server actually returns"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// before calling create_redis_connection\nlet info: String = redis::cmd(\"INFO\").query(&mut conn)?;\nif !info.contains(\"redis_version:\") {\n    eprintln!(\"endpoint does not expose redis_version; check server/proxy\");\n}","typeGuard":null,"tryCatchPattern":"match create_redis_connection(&cfg) {\n    Err(e) if e.to_string().contains(\"Redis version not available\") => {\n        // fall back to a compatible-mode client or alert ops\n    }\n    other => other?,\n}","preventionTips":["Verify the endpoint with redis-cli INFO server before wiring it into config","Avoid routing this client through proxies that strip INFO fields","Pin the connection config to known Redis nodes in managed deployments"],"tags":["redis","version-detection","connection"],"backgroundTag":"empty-required-field","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}