{"record":{"id":"9fb9a54b700c6842","repo":"block/buzz","slug":"name-is-required-for-community-deletion","errorCode":null,"errorMessage":"{name} is required for community deletion","messagePattern":"(.+?) is required for community deletion","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/buzz-deletion/src/lib.rs","lineNumber":604,"sourceCode":"        \"BUZZ_REDIS_POOL_SIZE\",\n        16,\n    )));\n    let redis = redis_config\n        .create_pool(Some(deadpool_redis::Runtime::Tokio1))\n        .context(\"create deletion Redis pool\")?;\n    Ok(Services {\n        store,\n        media,\n        redis,\n    })\n}\n\nfn required_env(name: &str) -> Result<String> {\n    std::env::var(name)\n        .ok()\n        .map(|value| value.trim().to_owned())\n        .filter(|value| !value.is_empty())\n        .ok_or_else(|| anyhow::anyhow!(\"{name} is required for community deletion\"))\n}\n\nfn env_parse<T>(name: &str, default: T) -> T\nwhere\n    T: std::str::FromStr,\n{\n    std::env::var(name)\n        .ok()\n        .and_then(|value| value.parse().ok())\n        .unwrap_or(default)\n}\n\nfn validate_frozen_inventory(request: &DeletionRequest) -> Result<FrozenInventory> {\n    let frozen: FrozenInventory = serde_json::from_value(\n        request\n            .inventory_manifest\n            .clone()\n            .ok_or_else(|| permanent(\"approved request has no frozen inventory\"))?,","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/block/buzz/blob/f956e6fe06a76e50cbd8fba1a162482e752e7f1a/crates/buzz-deletion/src/lib.rs#L586-L622","documentation":"required_env() in buzz-deletion refuses to start when a mandatory variable is unset, empty, or whitespace-only; the message names the offending variable ({name}). The deletion pipeline reads PostgreSQL state and hard-deletes community data across the DB, S3 media, and Redis, so all backing stores must be explicitly configured: DATABASE_URL, BUZZ_S3_ENDPOINT, BUZZ_S3_ACCESS_KEY, BUZZ_S3_SECRET_KEY, BUZZ_S3_BUCKET, and REDIS_URL are required (S3 region defaults to us-east-1; pool sizes are optional). Unlike buzz-admin, there are NO localhost defaults for these — the destructive tool refuses to guess.","triggerScenarios":"Running any buzz-deletion command (submit, approve, run, loop…) with one of the required variables missing — most commonly REDIS_URL or the BUZZ_S3_* group, because operators commonly export only DATABASE_URL. Whitespace-only values ('BUZZ_S3_BUCKET=\"  \"') also trigger it since values are trimmed and checked for emptiness.","commonSituations":"Deletion executor deployed with the relay's minimal env instead of the full deletion profile; secrets injected only in the relay container, not the CLI/executor environment; commented-out S3 lines in .env after switching media stores; running the CLI locally with only dev DATABASE_URL set.","solutions":["Read the variable name in the message and export it: for community deletion you need DATABASE_URL, REDIS_URL, BUZZ_S3_ENDPOINT, BUZZ_S3_ACCESS_KEY, BUZZ_S3_SECRET_KEY, and BUZZ_S3_BUCKET (BUZZ_S3_REGION/AWS_REGION optional, defaults us-east-1).","Copy the values from the relay's environment — the S3 endpoint/bucket must be the SAME store the relay uploads media to, or deletion will miss blobs.","Re-run after fixing; the check repeats per variable, so fix them in one pass by validating your env file first.","Watch for whitespace-only values in .env files (trailing spaces, quoted empties) — they are treated as missing."],"exampleFix":"# before\nexport DATABASE_URL=postgres://buzz:buzz_dev@localhost:5432/buzz\nbuzz-deletion submit --requester npub1... --reason gdpr\n# error: BUZZ_S3_ENDPOINT is required for community deletion\n\n# after\nexport DATABASE_URL=postgres://buzz:buzz_dev@localhost:5432/buzz\nexport REDIS_URL=redis://localhost:6379\nexport BUZZ_S3_ENDPOINT=http://localhost:9000\nexport BUZZ_S3_ACCESS_KEY=minioadmin\nexport BUZZ_S3_SECRET_KEY=minioadmin\nexport BUZZ_S3_BUCKET=buzz-media\nbuzz-deletion submit --requester npub1... --reason gdpr","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# deletion preflight: every required variable present and non-blank\nrequired=(DATABASE_URL REDIS_URL BUZZ_S3_ENDPOINT BUZZ_S3_ACCESS_KEY BUZZ_S3_SECRET_KEY BUZZ_S3_BUCKET)\nfor name in \"${required[@]}\"; do\n  val=\"${!name}\"\n  if [ -z \"${val// /}\" ]; then echo \"$name is required for community deletion\" >&2; exit 1; fi\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain a deletion-specific env template listing all six required variables; audit it when media config changes.","Mirror the relay's S3/Redis settings exactly so deletion covers the same blobs the relay wrote.","Trim-check values in templates — whitespace-only counts as missing."],"tags":["buzz-deletion","env-var","configuration","s3","redis","database"],"backgroundTag":"missing-env-var","analyzedSha":"f956e6fe06a76e50cbd8fba1a162482e752e7f1a","analyzedAt":"2026-08-16T22:11:40.750Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}