Upgrading River Mastodon to v4.5.0: A Journey Through Architecture Mismatches
We recently upgraded our Mastodon instance from v4.4.4 to v4.5.0, bumping the Helm chart from 6.5.3 to 6.6.0. While the upgrade itself was straightforward, we encountered an interesting challenge that's worth sharing.
What's New in Mastodon v4.5.0?
The v4.5.0 release brings some exciting features:
- β¨ Quote Posts β Full support for authoring and displaying quotes
- π Dynamic Reply Fetching β Better conversation threading in the web UI
- π« Username Blocking β Server-wide username filtering
- π¨ Custom Emoji Overhaul β Complete rendering system rewrite
- π Enhanced Moderation Tools β Improved admin/moderator interface
- β‘ Performance Improvements β Optimized database queries
The Architecture Gotcha
Everything seemed perfect during the upgrade process. We:
- Merged the upstream chart cleanly
- Updated our custom configurations (LibreTranslate, Sentry integration)
- Built new Docker images with Sentry monitoring
- Pushed to our registry
But when we deployed, pods started crashing with a cryptic error:
exec /usr/local/bundle/bin/bundle: exec format error
The Root Cause
The issue? Architecture mismatch. We built our Docker images on an ARM64 Mac (Apple Silicon), but our Kubernetes cluster runs on AMD64 (x86_64) nodes. The images were perfectly validβjust for the wrong architecture!
The Fix
The solution was simple but important:
docker build --platform linux/amd64 \
-f Dockerfile.mastodon-sentry \
-t registry.example.com/mastodon-sentry:v4.5.0 \
. --push
By explicitly specifying --platform linux/amd64, Docker builds images compatible with our cluster architecture, even when building on ARM64 hardware.
We updated our build script to always include this flag, preventing future issues:
# Build for AMD64 (cluster architecture)
docker build --platform linux/amd64 \
-f Dockerfile.mastodon-sentry \
-t ${REGISTRY}/mastodon-sentry:${VERSION} \
. --push
Deployment Results
After rebuilding with the correct architecture:
- β All pods running healthy (web, streaming, sidekiq)
- β Elasticsearch cluster rolled out successfully
- β PostgreSQL remained stable
- β Zero data loss, minimal downtime
- β All customizations preserved (LibreTranslate, Sentry, custom log levels)
Deployment Stats: β Total time: ~2 hours (including troubleshooting) β Downtime: Minimal (rolling update)
Lessons Learned
- Always specify target platform when building images for deployment, especially in cross-architecture development environments
- Build scripts should be architecture-aware to prevent silent failures
- Test deployments catch issues early β the error appeared immediately during pod startup
- Keep customizations isolated β Our values-river.yaml approach made the upgrade smooth
What's Next?
We still need to reindex Elasticsearch for the new search features:
kubectl exec -n mastodon deployment/river-mastodon-web -- \
tootctl search deploy
This will update search indices for all accounts, statuses, and tags to take advantage of v4.5.0's improved search capabilities.
Key Takeaway
Modern development often happens on ARM64 Macs while production runs on AMD64 servers. Docker's multi-platform build support makes this seamlessβbut only if you remember to use it! A simple --platform flag saved us from a much longer debugging session.
Happy federating! π
Resources: β Mastodon v4.5.0 Release Notes β Docker Multi-Platform Builds β Mastodon Helm Chart
Our instance runs on Kubernetes with custom Sentry monitoring, LibreTranslate integration, and an alternative Redis implementation. All chart templates remain identical to upstream, with customizations isolated in our values file.
Comment in the Fediverse @saint@river.group.lt