block/buzz · critical · anyhow::Error
failed to initialize media storage: {e}
Error message
failed to initialize media storage: {e} What it means
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.
Source
Thrown at crates/buzz-relay/src/main.rs:453
tracing::warn!(
pubkey = %keys.public_key().to_hex(),
"Using hardcoded dev relay keypair (BUZZ_REQUIRE_AUTH_TOKEN=false). \
Set BUZZ_RELAY_PRIVATE_KEY for production."
);
keys
} else {
panic!(
"BUZZ_RELAY_PRIVATE_KEY must be set when BUZZ_REQUIRE_AUTH_TOKEN=true. \
A stable relay identity is required for production."
);
};
config
.media
.validate()
.map_err(|e| anyhow::anyhow!("invalid media config: {e}"))?;
let media_storage = buzz_media::MediaStorage::new(&config.media)
.map_err(|e| anyhow::anyhow!("failed to initialize media storage: {e}"))?;
info!("Media storage connected");
let (app_state, audit_shutdown) = AppState::new(
config.clone(),
db,
redis_health_pool,
audit,
pubsub,
auth,
search,
Arc::clone(&workflow_engine),
relay_keypair,
media_storage,
);
let state = Arc::new(app_state);
// Inter-relay mesh (BUZZ_MESH seam). `boot_mesh` returns None when the
// kill switch is off — nothing is bound, published, or spawned, so theView on GitHub (pinned to f956e6fe06)
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 ...`
Example fix
# before BUZZ_MEDIA_S3_ENDPOINT=minio.internal:9000 # after BUZZ_MEDIA_S3_ENDPOINT=http://minio.internal:9000
Defensive patterns
Strategy: validation
Validate before calling
# Rehearse the storage config outside the relay before boot.
aws s3 ls --endpoint-url "$BUZZ_MEDIA_S3_ENDPOINT" s3://$BUZZ_MEDIA_S3_BUCKET/ || { echo 'media storage not usable'; exit 1; } Prevention
- 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
When it happens
Trigger: 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).
Common situations: Typo'd local MinIO endpoint (missing http://); wrong region codes; only one of the credential pair injected by the secret store.
Related errors
- invalid media config: {e}
- Configuration error: {e}
- RELAY_OWNER_PUBKEY required when BUZZ_REQUIRE_RELAY_MEMBERSH
- BUZZ_RELAY_PRIVATE_KEY is required when BUZZ_REQUIRE_RELAY_M
- Cannot derive a community host from BUZZ_RELAY_URL ({:?}); a
AI-assisted analysis of block/buzz@f956e6fe06 (2026-08-16).
Data as JSON: /api/errors/5e2ec4a3b7550791.
Report an issue: GitHub.