Skip to content

Latest commit

 

History

History
280 lines (220 loc) · 8.17 KB

File metadata and controls

280 lines (220 loc) · 8.17 KB

Changelog - RabbitMQ Credentials Fix for Revolt

Summary

This branch provides a complete solution for fixing RabbitMQ authentication issues in Revolt deployments, specifically addressing the "PLAIN login refused: user 'rabbituser' - invalid credentials" error that causes API and pushd services to crash.

Solution Overview

The solution includes:

  • Automated fix script for immediate resolution
  • Diagnostic test suite for verification and troubleshooting
  • Reference implementation showing proper configuration
  • Comprehensive documentation covering multiple scenarios
  • Quick-start guides for users needing urgent fixes

Files Added

Scripts (Executable)

  1. revolt-rabbitmq-credentials-fix.sh (5.0KB)

    • Automated fix script
    • Creates RabbitMQ user with correct credentials
    • Updates environment configuration
    • Provides post-fix instructions
    • Usage: ./revolt-rabbitmq-credentials-fix.sh [directory]
  2. test-rabbitmq-connection.sh (9.1KB)

    • Comprehensive diagnostic test suite
    • 10 automated tests covering all aspects
    • Color-coded output for easy reading
    • Provides actionable recommendations
    • Usage: ./test-rabbitmq-connection.sh [directory]

Documentation (Markdown)

  1. README_RABBITMQ_FIX.md (8.9KB)

    • Main entry point for the solution
    • Overview of the problem and solutions
    • Quick-start guides for different scenarios
    • Navigation to all resources
    • Best practices and security recommendations
  2. QUICK_FIX_GUIDE.md (2.2KB)

    • Immediate solutions for active issues
    • Copy-paste commands for fast resolution
    • Both automated and manual options
    • Verification steps
    • Designed for urgent troubleshooting
  3. REVOLT_RABBITMQ_FIX.md (7.1KB)

    • Detailed technical documentation
    • Root cause analysis
    • Multiple solution approaches
    • Comprehensive troubleshooting guide
    • Common issues and resolutions
    • Security best practices

Configuration Examples

  1. docker-compose-rabbitmq-example.yml (5.8KB)
    • Reference Docker Compose configuration
    • Properly configured RabbitMQ service
    • Environment variable examples
    • Service dependencies and health checks
    • Inline documentation and comments
    • Security recommendations

Commits

1ce9da8 Update documentation to include test script references
d941ad0 Add comprehensive RabbitMQ connection test script
76c18be Add comprehensive README for RabbitMQ fix solution
69851e5 Add Docker Compose example with proper RabbitMQ configuration
f3fa707 Add quick fix guide for immediate troubleshooting
e0525f1 Add RabbitMQ credentials fix for Revolt deployment

Problem Addressed

Error Symptoms

  • API (revolt-delta) and pushd services crash on startup
  • RabbitMQ logs show: "PLAIN login refused: user 'rabbituser' - invalid credentials"
  • Services restart continuously with error: "Connection reset by peer (os error 104)"

Root Cause

  • RabbitMQ starts without the required user credentials
  • Revolt services expect user 'rabbituser' with specific password
  • Mismatch causes authentication failures
  • Services panic and crash due to connection errors

Impact

  • Revolt deployment fails to start properly
  • Real-time messaging features unavailable
  • Push notifications don't work
  • API endpoints return errors

Solution Features

1. Automated Fix Script

  • Detects and creates RabbitMQ user
  • Sets proper permissions automatically
  • Updates .env file with credentials
  • Provides clear next steps
  • Handles edge cases (existing users, missing files)

2. Diagnostic Test Suite

  • 10 comprehensive tests
  • Container and service health checks
  • User and permission validation
  • Environment configuration verification
  • Service connectivity testing
  • Log analysis for recent errors
  • Color-coded results
  • Actionable recommendations

3. Preventive Configuration

  • Example docker-compose.yml with correct setup
  • Environment variable documentation
  • Healthcheck configurations
  • Service dependency management
  • Security hardening examples

4. Documentation

  • Multiple documentation levels (quick, detailed, comprehensive)
  • Scenario-based guidance
  • Troubleshooting flowcharts
  • Security best practices
  • Production deployment guide

Usage Scenarios

Scenario 1: Services Currently Crashing

Solution: Run automated fix script

./revolt-rabbitmq-credentials-fix.sh /opt/matrix-discord-killer
docker compose restart api pushd events

Scenario 2: New Deployment

Solution: Use reference configuration

cp docker-compose-rabbitmq-example.yml docker-compose.yml
# Edit and configure, then:
docker compose up -d

Scenario 3: Diagnosis Needed

Solution: Run test suite

./test-rabbitmq-connection.sh /opt/matrix-discord-killer

Testing & Validation

The solution has been designed to handle:

  • ✅ Missing RabbitMQ user
  • ✅ Incorrect user permissions
  • ✅ Missing environment configuration
  • ✅ Running containers (hot-fix)
  • ✅ Fresh deployments (prevention)
  • ✅ Multiple container naming schemes
  • ✅ Docker Compose v1 and v2

Security Considerations

Implemented

  • Credential redaction in logs and output
  • .env file backup before modification
  • Permission validation
  • Secure default recommendations

Documented

  • Password generation examples
  • Production security checklist
  • Environment file protection
  • Secret management recommendations
  • Network security guidance

Backward Compatibility

  • Works with existing Revolt deployments
  • No breaking changes to configurations
  • Optional .env file creation
  • Preserves existing settings when possible
  • Backward compatible with older Docker Compose

Known Limitations

  1. Manual credential sync required if changing passwords
  2. Requires container access (Docker permissions needed)
  3. English-only documentation (translations welcome)
  4. Tested with RabbitMQ 4.x (may work with 3.x)

Future Enhancements

Potential improvements for future versions:

  • Interactive credential setup wizard
  • Multi-language support for documentation
  • Integration with external secret managers
  • Automated credential rotation
  • Monitoring integration (Prometheus, etc.)
  • Web-based diagnostic interface

Support & Troubleshooting

If the fix doesn't work

  1. Run the diagnostic test:

    ./test-rabbitmq-connection.sh
  2. Check detailed logs:

    docker compose logs --tail=100 api pushd rabbit
  3. Verify Docker network:

    docker network inspect <network-name>
  4. Complete restart:

    docker compose down && docker compose up -d

Common Issues

Issue Solution Reference
User exists but wrong password Delete and recreate user REVOLT_RABBITMQ_FIX.md
.env not being read Add env_file to services docker-compose-rabbitmq-example.yml
Network connectivity Check Docker network config REVOLT_RABBITMQ_FIX.md
Permissions denied Grant full permissions revolt-rabbitmq-credentials-fix.sh

Contributing

Contributions welcome! Areas for improvement:

  • Additional test cases
  • More language translations
  • Platform-specific fixes (Windows, macOS)
  • Integration with other deployment methods (Kubernetes, etc.)
  • Additional example configurations

License

Provided as-is for the Revolt and open-source community.

Acknowledgments

  • Revolt team for the self-hosted chat platform
  • Community members reporting the RabbitMQ credential issue
  • Contributors to the documentation and testing

Resources

Version Information

  • Created: 2026-02-14
  • Branch: cursor/rabbitmq-connection-credentials-0f84
  • Commits: 6
  • Files Added: 6
  • Total Lines: ~1,100+
  • Status: ✅ Ready for Merge

Quick Links: