{"record":{"id":"862c86efb6a85b2f","repo":"block/buzz","slug":"invalid-media-config-e","errorCode":null,"errorMessage":"invalid media config: {e}","messagePattern":"invalid media config: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/buzz-relay/src/main.rs","lineNumber":451,"sourceCode":"            \"0000000000000000000000000000000000000000000000000000000000000001\";\n        let keys = nostr::Keys::parse(DEV_RELAY_PRIVKEY).expect(\"hardcoded dev key is valid\");\n        tracing::warn!(\n            pubkey = %keys.public_key().to_hex(),\n            \"Using hardcoded dev relay keypair (BUZZ_REQUIRE_AUTH_TOKEN=false). \\\n             Set BUZZ_RELAY_PRIVATE_KEY for production.\"\n        );\n        keys\n    } else {\n        panic!(\n            \"BUZZ_RELAY_PRIVATE_KEY must be set when BUZZ_REQUIRE_AUTH_TOKEN=true. \\\n             A stable relay identity is required for production.\"\n        );\n    };\n\n    config\n        .media\n        .validate()\n        .map_err(|e| anyhow::anyhow!(\"invalid media config: {e}\"))?;\n    let media_storage = buzz_media::MediaStorage::new(&config.media)\n        .map_err(|e| anyhow::anyhow!(\"failed to initialize media storage: {e}\"))?;\n    info!(\"Media storage connected\");\n\n    let (app_state, audit_shutdown) = AppState::new(\n        config.clone(),\n        db,\n        redis_health_pool,\n        audit,\n        pubsub,\n        auth,\n        search,\n        Arc::clone(&workflow_engine),\n        relay_keypair,\n        media_storage,\n    );\n    let state = Arc::new(app_state);\n","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/block/buzz/blob/f956e6fe06a76e50cbd8fba1a162482e752e7f1a/crates/buzz-relay/src/main.rs#L433-L469","documentation":"config.media.validate() checks the media (Blossom/S3) configuration before any storage client is built. Missing required fields for the selected backend — e.g. S3 without bucket, region, or endpoint — surface here with the validation message appended, aborting startup.","triggerScenarios":"Selecting an S3-backed media backend without providing all required S3 env vars; combining incompatible media storage options.","commonSituations":"Enabling media uploads in a new environment with only a partial env set; media env var renames between releases; copying .env from a local-disk setup into an S3 deployment.","solutions":["Read {e} — it names the missing or invalid media field","Complete the media section of .env per .env.example for the chosen backend","If media is not needed, revert the media config to the disabled/local default"],"exampleFix":"# before\nBUZZ_MEDIA_BACKEND=s3\n# BUZZ_MEDIA_S3_BUCKET unset\n\n# after\nBUZZ_MEDIA_BACKEND=s3\nBUZZ_MEDIA_S3_BUCKET=buzz-media\nBUZZ_MEDIA_S3_REGION=us-east-1","handlingStrategy":"validation","validationCode":"# Every media var referenced by the active backend must be set.\nif [ \"${BUZZ_MEDIA_BACKEND:-}\" = \"s3\" ]; then\n  for v in BUZZ_MEDIA_S3_BUCKET BUZZ_MEDIA_S3_REGION; do\n    [ -n \"${!v:-}\" ] || { echo \"missing $v\"; exit 1; }\n  done\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fill the entire media section of .env.example when enabling media","Add env completeness checks per backend to the deploy pipeline","Re-check media env after upgrades in case variable names changed"],"tags":["config","media","s3","blossom","env-vars","startup"],"backgroundTag":"config-validation-failed","analyzedSha":"f956e6fe06a76e50cbd8fba1a162482e752e7f1a","analyzedAt":"2026-08-16T22:11:40.750Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}