Content-Length: 312027 | pFad | http://github.com/celery/celery/pull/9723

42 fix(cli): show user-friendly error message for celery status when broker is unreachable (#9722) by yiyu0x · Pull Request #9723 · celery/celery · GitHub
Skip to content

fix(cli): show user-friendly error message for celery status when broker is unreachable (#9722) #9723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yiyu0x
Copy link
Contributor

@yiyu0x yiyu0x commented May 22, 2025

Description

This pull request addresses issue #9722.

When running celery status, if the message broker (e.g., RabbitMQ or Redis) is unreachable, the CLI previously displayed a full Python traceback, which is not user-friendly. This PR updates the status command to show a clear, concise error message explaining the problem and possible solutions, and to handle unexpected errors with a concise message as well.

Before

  • Users would see a full traceback when the broker was not running or connection settings were incorrect.

After

  • Users now see a message like:
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
  • For other unexpected errors, a concise message is shown instead of a traceback.

Related Issue

Checklist

  • User experience is improved for CLI error handling.
  • No traceback is shown for broker connection errors.
  • Unexpected errors are handled gracefully.

Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 28.57143% with 10 lines in your changes missing coverage. Please review.

Project coverage is 78.47%. Comparing base (778b009) to head (33eca42).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
celery/bin/celery.py 28.57% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9723      +/-   ##
==========================================
- Coverage   78.51%   78.47%   -0.04%     
==========================================
  Files         153      153              
  Lines       19127    19140      +13     
  Branches     2533     2534       +1     
==========================================
+ Hits        15018    15021       +3     
- Misses       3821     3831      +10     
  Partials      288      288              
Flag Coverage Δ
unittests 78.45% <28.57%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Nusnus Nusnus self-requested a review May 22, 2025 19:00
@auvipy auvipy added this to the 5.7.0 milestone May 27, 2025
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add unit test to verify this change

@Nusnus Nusnus force-pushed the feature/user-friendly-celery-status-errors branch from 57f60fe to 33eca42 Compare May 31, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/celery/celery/pull/9723

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy