{"record":{"id":"3943d06342ff1a69","repo":"risingwavelabs/risingwave","slug":"redis-error-0","errorCode":null,"errorMessage":"Redis error: {0}","messagePattern":"Redis error: (.+?)","errorType":"exception","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/mod.rs","lineNumber":1128,"sourceCode":"        #[source]\n        #[backtrace]\n        anyhow::Error,\n    ),\n    #[error(\"config error: {0}\")]\n    Config(\n        #[source]\n        #[backtrace]\n        anyhow::Error,\n    ),\n    #[error(\"coordinator error: {0}\")]\n    Coordinator(\n        #[source]\n        #[backtrace]\n        anyhow::Error,\n    ),\n    #[error(\"ClickHouse error: {0}\")]\n    ClickHouse(String),\n    #[error(\"Redis error: {0}\")]\n    Redis(String),\n    #[error(\"Http error: {0}\")]\n    Http(\n        #[source]\n        #[backtrace]\n        anyhow::Error,\n    ),\n    #[error(\"Mqtt error: {0}\")]\n    Mqtt(\n        #[source]\n        #[backtrace]\n        anyhow::Error,\n    ),\n    #[error(\"Nats error: {0}\")]\n    Nats(\n        #[source]\n        #[backtrace]\n        anyhow::Error,","sourceCodeStart":1110,"sourceCodeEnd":1146,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/mod.rs#L1110-L1146","documentation":"SinkError::Redis(String) in src/connector/src/sink/mod.rs:1129 wraps any failure from the Redis sink while writing/reading data through a Redis instance. It is raised when the Redis sink connector cannot complete an operation such as LPUSH/RPUSH to a list key, connection establishment, or command execution. The payload is a human-readable string (often the Display of an underlying redis-rs error) describing what went wrong.","triggerScenarios":"Using CREATE SINK ... WITH (connector='redis') and the sink fails during startup or streaming: Redis server unreachable/wrong host:port, wrong password (AUTH failure), Redis OOM (maxmemory reached), WRONGTYPE errors when writing a value to a key holding a different type, or I/O timeout during command execution.","commonSituations":"Redis not running or firewalled on the configured endpoint; stale Redis credentials after a rotation; trying to append to an existing key that is a string or hash instead of a list (WRONGTYPE); Redis maxmemory eviction blocking writes; connection pool exhaustion under high sink throughput.","solutions":["Verify Redis connectivity from the RisingWave host (redis-cli -h <host> -p <port> ping) and fix the host/port/URL in the sink WITH options.","Check the password/TLS settings in the sink definition match the Redis instance (requirepass / ACL).","Run TYPE on the target key; delete or rename the key if its type conflicts with the sink's expected list type (WRONGTYPE).","Inspect INFO memory on Redis; raise maxmemory or enable eviction if OOM errors are reported.","Check RisingWave logs for the embedded redis-rs error detail to identify retryable I/O errors vs permanent command errors."],"exampleFix":"// before: key 'events' already holds a string, sink LPUSH fails with WRONGTYPE\n// after: delete the conflicting key before recreating the sink\n// redis-cli DEL events\nCREATE SINK redis_sink FROM mv WITH (\n  connector = 'redis',\n  redis.url = 'redis://:password@redis-host:6379'\n);","handlingStrategy":"try-catch","validationCode":"// Before creating the sink, validate Redis connectivity and key type\nlet client = redis::Client::open(redis_url)?;\nlet mut conn = client.get_connection()?;\nredis::cmd(\"PING\").query::<String>(&mut conn)?;\nif let Ok(t) = redis::cmd(\"TYPE\").arg(&key).query::<String>(&mut conn) {\n    assert!(t == \"none\" || t == \"list\", \"key {key} holds incompatible type {t}\");\n}","typeGuard":"fn is_redis_config_ok(url: &str) -> bool {\n    url.starts_with(\"redis://\") || url.starts_with(\"rediss://\")\n}","tryCatchPattern":"// Rust: match on the SinkError variant\nmatch sink_result {\n    Err(SinkError::Redis(msg)) if msg.contains(\"WRONGTYPE\") => fix_key_type_and_recreate_sink(),\n    Err(SinkError::Redis(msg)) if msg.contains(\"connection\") => retry_with_backoff(),\n    Err(e) => log_and_alert(&e.to_string()),\n    Ok(v) => process(v),\n}","preventionTips":["Pre-flight PING and AUTH check against Redis before creating the sink","Ensure the target key is absent or a list (run TYPE) so LPUSH/RPUSH never hits WRONGTYPE","Monitor Redis maxmemory and set an eviction policy appropriate to your durability needs","Use rediss:// with valid CA config when TLS is required","Alert on RisingWave sink error metrics to catch credential rotations early"],"tags":["redis","sink","network","risingwave-connector"],"backgroundTag":"database-write-failed","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}