{"record":{"id":"a75fa7092bef5d43","repo":"block/buzz","slug":"redis-pool-creation-failed-e","errorCode":null,"errorMessage":"Redis pool creation failed: {e}","messagePattern":"Redis pool creation failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/buzz-admin/src/main.rs","lineNumber":421,"sourceCode":"    let db = connect_db().await?;\n\n    let relay_keypair = {\n        let hex = std::env::var(\"BUZZ_RELAY_PRIVATE_KEY\").map_err(|_| {\n            anyhow::anyhow!(\n                \"BUZZ_RELAY_PRIVATE_KEY is required for add-member/remove-member.\\n\\\n                 The relay must have a stable signing key to publish kind:13534 events.\"\n            )\n        })?;\n        Keys::parse(&hex).map_err(|e| anyhow::anyhow!(\"invalid BUZZ_RELAY_PRIVATE_KEY: {e}\"))?\n    };\n\n    let redis_url =\n        std::env::var(\"REDIS_URL\").unwrap_or_else(|_| \"redis://localhost:6379\".to_string());\n\n    let redis_pool = {\n        let cfg = deadpool_redis::Config::from_url(&redis_url);\n        cfg.create_pool(Some(deadpool_redis::Runtime::Tokio1))\n            .map_err(|e| anyhow::anyhow!(\"Redis pool creation failed: {e}\"))?\n    };\n\n    let pubsub = Arc::new(\n        PubSubManager::new(&redis_url, redis_pool)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"PubSub init failed: {e}\"))?,\n    );\n\n    Ok((db, pubsub, relay_keypair))\n}\n\nasync fn connect_db() -> Result<Db> {\n    let db_url = std::env::var(\"DATABASE_URL\")\n        .unwrap_or_else(|_| \"postgres://buzz:buzz_dev@localhost:5432/buzz\".to_string());\n    let db = Db::new(&DbConfig {\n        database_url: db_url,\n        ..DbConfig::default()\n    })","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/block/buzz/blob/f956e6fe06a76e50cbd8fba1a162482e752e7f1a/crates/buzz-admin/src/main.rs#L403-L439","documentation":"deadpool_redis::Config::from_url(REDIS_URL).create_pool() failed while connect_member_services() was wiring up Redis for add-member/remove-member. Pool creation fails at construction time when the URL cannot be parsed into a valid Redis configuration — typically an unsupported scheme, missing/garbled host, or malformed query parameters. Note REDIS_URL defaults to redis://localhost:6379 when unset, so a plain missing variable does NOT trigger this; a present-but-malformed one does. Network reachability is NOT checked here (that surfaces later as a checkout/timeout error), though some URL-level auth/TLS settings are validated eagerly.","triggerScenarios":"REDIS_URL set to a Postgres-style URL (postgres://…), a URL with a typo in the scheme (rediss:/localhost), an empty redis:// with no host plus strict parsing, or an invalid query param appended (e.g. redis://host:6379?foo=bar).","commonSituations":"Operators pasting DATABASE_URL into the REDIS_URL slot; enabling TLS by writing rediss:// without a valid endpoint; copy-paste truncation of the URL; .env values with unexpanded variables (`redis://$REDIS_HOST:6379` kept literal).","solutions":["Check the exact REDIS_URL value: it must be a redis://host:port or rediss://host:port (TLS) URL, e.g. redis://localhost:6379.","Print and inspect it in the same shell that runs buzz-admin: `echo \"$REDIS_URL\"` — look for missing scheme, stray quotes, or a pasted postgres:// URL.","Unset the variable to fall back to the redis://localhost:6379 default if that is actually where Redis lives.","If the {e} detail mentions TLS/auth params, fix or remove those query parameters (password goes as redis://:password@host:6379)."],"exampleFix":"# before\nREDIS_URL=postgres://buzz:buzz_dev@localhost:5432/buzz\n\n# after\nREDIS_URL=redis://localhost:6379","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# REDIS_URL must parse as a redis(s) URL before buzz-admin runs\nurl=\"${REDIS_URL:-redis://localhost:6379}\"\nif ! [[ \"$url\" =~ ^rediss?://[^/]+ ]]; then\n  echo \"REDIS_URL is not a valid redis:// or rediss:// URL: $url\" >&2\n  exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a lint rule in env templates: REDIS_URL starts with redis:// or rediss://.","Don't reuse database URL variables for Redis — explicit per-store variables prevent swap mistakes.","Unset rather than empty the variable when you want the localhost default."],"tags":["buzz-admin","redis","deadpool","url-parsing","configuration"],"backgroundTag":"invalid-connection-url","analyzedSha":"f956e6fe06a76e50cbd8fba1a162482e752e7f1a","analyzedAt":"2026-08-16T22:11:40.750Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}