Skip to content

celery status should show user-friendly error message instead of traceback when broker is unreachable #9722

Description

@yiyu0x

Checklist

  • I have checked the issues list
    for similar or identical enhancement to an existing feature.
  • I have checked the pull requests list
    for existing proposed enhancements.
  • I have checked the commit log
    to find out if the same enhancement was already implemented in the
    main branch.
  • I have included all related issues and possible duplicate issues in this issue
    (If there are none, check this box anyway).

Related Issues and Possible Duplicates

Related Issues

  • None

Possible Duplicates

  • None

Brief Summary

When running celery status, if the message broker (e.g., RabbitMQ or Redis) is unreachable, the CLI currently outputs a full Python traceback. This is not user-friendly. The command should display a clear, concise error message explaining the problem and possible solutions, rather than a raw traceback.

Design

Architectural Considerations

None

Proposed Behavior

  • When the broker is unreachable, celery status should print a user-friendly error message, such as:
Could not connect to the message broker. Please make sure your broker (e.g., RabbitMQ or Redis) is running and the connection settings are correct. Reason: [Errno 111] Connection refused
  • The command should not print a full Python traceback.
  • For any other unexpected errors, a concise error message should be shown, not a traceback.

Proposed UI/UX

  • CLI output should be clear and actionable for end users.
  • No traceback should be shown for connection or unexpected errors; only a summary and the exception string.

Diagrams

N/A

Alternatives

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions