{"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":514,"sourceCode":"        .connect(search_db_url)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Search DB connection failed: {e}\"))?;\n    let search_metrics_pool = search_pool.clone();\n    let search = SearchService::new(search_pool);\n    info!(\n        replica = config.read_database_url.is_some(),\n        \"Search service ready (Postgres FTS)\"\n    );\n\n    let workflow_config = buzz_workflow::WorkflowConfig::default();\n    let workflow_engine = Arc::new(WorkflowEngine::new(db.clone(), workflow_config));\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":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/block/buzz/blob/ef2aa1ae38fadcc0bc22b8bf6ed96b35933146be/crates/buzz-relay/src/main.rs#L496-L532","documentation":"Fatal startup error: buzz_media::MediaStorage::new() failed while standing up media storage from config.media (after validate() already passed). This step constructs the S3/MinIO client against the configured endpoint, bucket, credentials, region, and addressing style — failures here are connectivity, credentials, bucket, or endpoint-shape problems.","triggerScenarios":"S3 endpoint unreachable or wrong (self-hosted MinIO down / wrong port), the bucket does not exist, credentials are rejected, path-style vs virtual-host addressing mismatch, or an AWS region that does not match the endpoint so signatures are scoped wrong.","commonSituations":"MinIO container not up when the relay boots; bucket name typo; rotating S3 keys without updating the relay secret; switching between path-style (MinIO default) and virtual-host style without DNS to match.","solutions":["Verify the endpoint and bucket from the same host: aws --endpoint-url $BUZZ_MEDIA_S3_ENDPOINT s3 ls s3://$BUZZ_MEDIA_S3_BUCKET (or mc for MinIO)","Create the bucket if missing, or fix its name","Update credentials/region: region must match the endpoint's region for real AWS S3","Check the addressing style matches your S3 implementation (path-style for MinIO)","Restart the relay once storage checks pass"],"exampleFix":"# before\nexport BUZZ_MEDIA_S3_ENDPOINT=http://minio:9000\nexport BUZZ_MEDIA_S3_BUCKET=media\n# bucket never created -> init fails\n\n# after\nmc alias set local http://minio:9000 $MINIO_ROOT_USER $MINIO_ROOT_PASSWORD\nmc mb local/media\nexport BUZZ_MEDIA_S3_ENDPOINT=http://minio:9000\nexport BUZZ_MEDIA_S3_BUCKET=media","handlingStrategy":"validation","validationCode":"# Boot gate: prove bucket access with the same coordinates the relay uses:\naws --endpoint-url \"$BUZZ_MEDIA_S3_ENDPOINT\" s3 ls \"s3://${BUZZ_MEDIA_S3_BUCKET:?}\" >/dev/null \\\n  || { echo 'media bucket unreachable'; exit 1; }","typeGuard":null,"tryCatchPattern":"// Retry startup only for transient S3 outages; credential/bucket errors are\n// configuration fixes followed by a restart.","preventionTips":["Create the media bucket before first relay boot","Keep endpoint, region, credentials, and addressing style consistent (path-style for MinIO)","Rotate S3 keys through the same deploy that restarts the relay"],"tags":["s3","minio","media","connection","startup","buzz-relay"],"backgroundTag":"s3-storage-init-failed","analyzedSha":"ef2aa1ae38fadcc0bc22b8bf6ed96b35933146be","analyzedAt":"2026-08-20T04:38:24.874Z","contentChangedAt":"2026-08-20T04:38:24.874Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}