{"record":{"id":"5e2ec4a3b7550791","repo":"block/buzz","slug":"failed-to-initialize-media-storage-e","errorCode":null,"errorMessage":"failed to initialize media storage: {e}","messagePattern":"failed to initialize media storage: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/buzz-relay/src/main.rs","lineNumber":453,"sourceCode":"        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\n    // Inter-relay mesh (BUZZ_MESH seam). `boot_mesh` returns None when the\n    // kill switch is off — nothing is bound, published, or spawned, so the","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/block/buzz/blob/f956e6fe06a76e50cbd8fba1a162482e752e7f1a/crates/buzz-relay/src/main.rs#L435-L471","documentation":"MediaStorage::new() constructs the actual storage client (S3/Blossom endpoint) after validation has passed. Failures at this stage — a malformed endpoint URL, credentials rejected during client construction, or an unsupported backend combination — abort startup with the SDK-level error appended.","triggerScenarios":"The media/S3 endpoint URL is malformed (e.g. MinIO endpoint without a scheme), region/credential configuration rejected by the SDK at construction, or partial credentials (access key without secret).","commonSituations":"Typo'd local MinIO endpoint (missing http://); wrong region codes; only one of the credential pair injected by the secret store.","solutions":["Check {e} for the SDK-level cause it wraps","Fix the media endpoint URL (include the scheme) and provide the full credential pair","Rehearse the same values outside the relay: `aws s3 ls --endpoint-url ...`"],"exampleFix":"# before\nBUZZ_MEDIA_S3_ENDPOINT=minio.internal:9000\n\n# after\nBUZZ_MEDIA_S3_ENDPOINT=http://minio.internal:9000","handlingStrategy":"validation","validationCode":"# Rehearse the storage config outside the relay before boot.\naws s3 ls --endpoint-url \"$BUZZ_MEDIA_S3_ENDPOINT\" s3://$BUZZ_MEDIA_S3_BUCKET/ || { echo 'media storage not usable'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include the scheme in S3 endpoint URLs (http:// for local MinIO)","Inject credentials as a pair — access key and secret together","Verify region codes against the actual bucket"],"tags":["media","s3","storage","startup","config"],"backgroundTag":"storage-initialization-failed","analyzedSha":"f956e6fe06a76e50cbd8fba1a162482e752e7f1a","analyzedAt":"2026-08-16T22:11:40.750Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}