Skip to content

Fix#9722 friendly status errors for CLI#10190

Merged
auvipy merged 4 commits into
celery:mainfrom
ChickenBenny:fix/9722-friendly-status-errors
Mar 11, 2026
Merged

Fix#9722 friendly status errors for CLI#10190
auvipy merged 4 commits into
celery:mainfrom
ChickenBenny:fix/9722-friendly-status-errors

Conversation

@ChickenBenny

@ChickenBenny ChickenBenny commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Thanks @harshang03 for the awesome work on #10118! The UX improvement for CLI broker errors is fantastic and much needed.

I noticed that Codecov reported some missing coverage and @auvipy requested additional tests. Since the PR hasn't been updated in about a month, I went ahead and added the missing unit tests to cover the remaining try...except blocks to help get this over the finish line.

What was added

Added unit tests to simulate OperationalError and unexpected exceptions for the following commands, ensuring the handle_remote_command_error is triggered correctly:

  • celery inspect <command>
  • celery control <command> (broadcast)
  • celery events (covering the _run_evcam and _run_evtop paths)

issue #9722

harshang03 and others added 2 commits March 11, 2026 14:00
Convert broker connection failures in `status` into concise actionable CLI errors instead of tracebacks, and apply the same error handling path to related remote CLI flows.
Add regression coverage for broker-unreachable and unexpected-error handling in status/graph/events command paths.
@codecov

codecov Bot commented Mar 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.21%. Comparing base (66bcdeb) to head (3c505f5).
⚠️ Report is 73 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10190      +/-   ##
==========================================
+ Coverage   88.16%   88.21%   +0.05%     
==========================================
  Files         153      153              
  Lines       19526    19547      +21     
  Branches     2244     2246       +2     
==========================================
+ Hits        17215    17244      +29     
+ Misses       2013     2005       -8     
  Partials      298      298              
Flag Coverage Δ
unittests 88.19% <100.00%> (+0.05%) ⬆️

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

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

@auvipy
auvipy requested a review from Copilot March 11, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@auvipy
auvipy requested review from auvipy and Copilot March 11, 2026 09:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@auvipy auvipy added this to the 5.7.0 milestone Mar 11, 2026

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we were using https://pypi.org/project/pytest-click/ in some of the existing tests regarding click. are we using it here as well? or it is not that useful here? also do we need extra documentations here?

@auvipy auvipy changed the title Fix/9722 friendly status errors Fix#9722 friendly status errors for CLI Mar 11, 2026
@ChickenBenny

Copy link
Copy Markdown
Contributor Author

Ah, good catch! I completely missed that we were already using pytest-click. Fix with 3c505f5

@auvipy
auvipy merged commit 7735d2b into celery:main Mar 11, 2026
356 checks passed
Nusnus pushed a commit that referenced this pull request Mar 26, 2026
* fix: show user-friendly broker errors for remote CLI commands

Convert broker connection failures in `status` into concise actionable CLI errors instead of tracebacks, and apply the same error handling path to related remote CLI flows.
Add regression coverage for broker-unreachable and unexpected-error handling in status/graph/events command paths.

* test: handle remote command error

* chore: use cli_runner in click package

---------

Co-authored-by: Harshang Akabari <[email protected]>
Nusnus pushed a commit that referenced this pull request Mar 26, 2026
* fix: show user-friendly broker errors for remote CLI commands

Convert broker connection failures in `status` into concise actionable CLI errors instead of tracebacks, and apply the same error handling path to related remote CLI flows.
Add regression coverage for broker-unreachable and unexpected-error handling in status/graph/events command paths.

* test: handle remote command error

* chore: use cli_runner in click package

---------

Co-authored-by: Harshang Akabari <[email protected]>
Nusnus pushed a commit that referenced this pull request Mar 26, 2026
* fix: show user-friendly broker errors for remote CLI commands

Convert broker connection failures in `status` into concise actionable CLI errors instead of tracebacks, and apply the same error handling path to related remote CLI flows.
Add regression coverage for broker-unreachable and unexpected-error handling in status/graph/events command paths.

* test: handle remote command error

* chore: use cli_runner in click package

---------

Co-authored-by: Harshang Akabari <[email protected]>
736-c41-2c1-e464fc974 pushed a commit to Swiss-Armed-Forces/Loom that referenced this pull request Mar 29, 2026
This MR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [celery](https://docs.celeryq.dev/) ([source](https://github.com/celery/celery), [changelog](https://docs.celeryq.dev/en/stable/changelog.html)) | dependencies | patch | `5.6.2` → `5.6.3` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/celery/celery/badge)](https://securityscorecards.dev/viewer/?uri=github.com/celery/celery) |

---

### Release Notes

<details>
<summary>celery/celery (celery)</summary>

### [`v5.6.3`](https://github.com/celery/celery/releases/tag/v5.6.3)

[Compare Source](celery/celery@v5.6.2...v5.6.3)

#### What's Changed

- Fix Django worker recursion bug + defensive checks for pool\_cls.**module** by [@&#8203;maycuatroi1](https://github.com/maycuatroi1) in [#&#8203;10048](celery/celery#10048)
- Docs: Update user\_preload\_options example to use click. by [@&#8203;jorsyk](https://github.com/jorsyk) in [#&#8203;10056](celery/celery#10056)
- Fix invalid configuration key "bootstrap\_servers" in Kafka demo by [@&#8203;jorsyk](https://github.com/jorsyk) in [#&#8203;10060](celery/celery#10060)
- Fix broken images on PyPI page by [@&#8203;Timour-Ilyas](https://github.com/Timour-Ilyas) in [#&#8203;10066](celery/celery#10066)
- Remove broken reference. by [@&#8203;sueannioanis](https://github.com/sueannioanis) in [#&#8203;10071](celery/celery#10071)
- Removed --dist=loadscope from smoke tests by [@&#8203;Nusnus](https://github.com/Nusnus) in [#&#8203;10073](celery/celery#10073)
- Docs: Clarify task\_retry signal args may be None by [@&#8203;GangEunzzang](https://github.com/GangEunzzang) in [#&#8203;10076](celery/celery#10076)
- Update example for Django by [@&#8203;sbc-khacnha](https://github.com/sbc-khacnha) in [#&#8203;10081](celery/celery#10081)
- Make tests compatible with pymongo >= 4.16 by [@&#8203;cjwatson](https://github.com/cjwatson) in [#&#8203;10074](celery/celery#10074)
- fix: source install of cassandra-driver by [@&#8203;Izzette](https://github.com/Izzette) in [#&#8203;10105](celery/celery#10105)
- fix: register task cross-reference role in Sphinx extension by [@&#8203;veeceey](https://github.com/veeceey) in [#&#8203;10100](celery/celery#10100)
- fix: avoid cycle detection in native delayed delivery by [@&#8203;Izzette](https://github.com/Izzette) in [#&#8203;10095](celery/celery#10095)
- fix(asynpool): avoid AttributeError when proc lacks \_sentinel\_poll by [@&#8203;mriddle](https://github.com/mriddle) in [#&#8203;10086](celery/celery#10086)
- fix dusk\_astronomical horizon sign (+18 -> -18) by [@&#8203;Mr-Neutr0n](https://github.com/Mr-Neutr0n) in [#&#8203;10121](celery/celery#10121)
- Fix/10106 onupdate col use lambda func by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10108](celery/celery#10108)
- Fix warm shutdown RuntimeError with eventlet>=0.37.0 ([#&#8203;10083](celery/celery#10083)) by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10123](celery/celery#10123)
- Fix 10109 db backend connection health by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10124](celery/celery#10124)
- Database Backend filter unsupport sql engine arguments with nullpool [#&#8203;7355](celery/celery#7355) by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10134](celery/celery#10134)
- fix(beat): correct argument order in Service.**reduce** by [@&#8203;bysiber](https://github.com/bysiber) in [#&#8203;10137](celery/celery#10137)
- ci: declare explicit read-only token permissions in workflow jobs by [@&#8203;Rohan5commit](https://github.com/Rohan5commit) in [#&#8203;10139](celery/celery#10139)
- chore: 'boto3to' to 'boto3 to' by [@&#8203;cuiweixie](https://github.com/cuiweixie) in [#&#8203;10133](celery/celery#10133)
- Database Backend: Add missing index on date\_done (Fixes [#&#8203;10097](celery/celery#10097)) by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10098](celery/celery#10098)
- docs: fix typo in CONTRIBUTING.rst by [@&#8203;Rohan5commit](https://github.com/Rohan5commit) in [#&#8203;10141](celery/celery#10141)
- Refer to Flower / Prometheus for monitoring by [@&#8203;WilliamDEdwards](https://github.com/WilliamDEdwards) in [#&#8203;10140](celery/celery#10140)
- docs: remove duplicated words in broker and routing docs by [@&#8203;Rohan5commit](https://github.com/Rohan5commit) in [#&#8203;10146](celery/celery#10146)
- docs: fix stale version reference and grammar in README by [@&#8203;kelsonbrito50](https://github.com/kelsonbrito50) in [#&#8203;10145](celery/celery#10145)
- docs: fix wording in Celery 5.3 worker pool notes by [@&#8203;Rohan5commit](https://github.com/Rohan5commit) in [#&#8203;10149](celery/celery#10149)
- docs: fix duplicated wording in 3.1 changelog entry by [@&#8203;Rohan5commit](https://github.com/Rohan5commit) in [#&#8203;10152](celery/celery#10152)
- docs: fix changelog typo in context manager wording by [@&#8203;Rohan5commit](https://github.com/Rohan5commit) in [#&#8203;10144](celery/celery#10144)
- Fix/10096 worker fails to reconnect after redis failover by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10151](celery/celery#10151)
- Improve on\_after\_finalize signal documentation by [@&#8203;Br1an67](https://github.com/Br1an67) in [#&#8203;10155](celery/celery#10155)
- Add non-commutative example to clarify partial arg ordering in canvas docs by [@&#8203;Br1an67](https://github.com/Br1an67) in [#&#8203;10157](celery/celery#10157)
- Remove redundant test\_isa\_mapping test (fixes [#&#8203;10077](celery/celery#10077)) by [@&#8203;daniel7an](https://github.com/daniel7an) in [#&#8203;10103](celery/celery#10103)
- Upgrade pytest-celery to >=1.3.0 and adopt PYTEST\_CELERY\_PKG build arg by [@&#8203;Nusnus](https://github.com/Nusnus) in [#&#8203;10162](celery/celery#10162)
- Remove deprecated args from redis get\_connection call by [@&#8203;JaeHyuckSa](https://github.com/JaeHyuckSa) in [#&#8203;10036](celery/celery#10036)
- Fix [#&#8203;6912](celery/celery#6912) rpc backend reconnection error by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10179](celery/celery#10179)
- Fix NameError with TYPE\_CHECKING annotations on Python 3.14+ (PEP 649) by [@&#8203;drichardson](https://github.com/drichardson) in [#&#8203;10165](celery/celery#10165)
- docs: Add elaboration on prefetch multiplier settings (worker\_prefetch\_multiplier) and worker\_eta\_task\_limit by [@&#8203;tsangwailam](https://github.com/tsangwailam) in [#&#8203;10181](celery/celery#10181)
- Fix O(K²) message bloat in a chain of chords by [@&#8203;Borzik](https://github.com/Borzik) in [#&#8203;10171](celery/celery#10171)
- Fix mock connection interfaces to prevent `TypeError` during exception handling by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10178](celery/celery#10178)
- fix(trace): dispatch chain/callbacks on dedup fast-path for redelivered tasks by [@&#8203;aurangzaib048](https://github.com/aurangzaib048) in [#&#8203;10159](celery/celery#10159)
- Extract `reconnect_on_error` to `BaseResultConsumer` by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10189](celery/celery#10189)
- pep 649 by [@&#8203;ericbuehl](https://github.com/ericbuehl) in [#&#8203;10187](celery/celery#10187)
- [Fix#9722](https://github.com/Fix/celery/issues/9722) friendly status errors for CLI by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10190](celery/celery#10190)
- docs: clarify after\_return behavior for retried tasks by [@&#8203;KianAnbarestani](https://github.com/KianAnbarestani) in [#&#8203;10192](celery/celery#10192)
- Add compression header to message protocol docs by [@&#8203;Br1an67](https://github.com/Br1an67) in [#&#8203;10156](celery/celery#10156)
- docs: fix duplicated word in bootsteps comment by [@&#8203;Rohan5commit](https://github.com/Rohan5commit) in [#&#8203;10153](celery/celery#10153)
- Remove outdated autoreloader section from extending docs by [@&#8203;Br1an67](https://github.com/Br1an67) in [#&#8203;10154](celery/celery#10154)
- Fix: prioritize request ignore\_result over task definition by [@&#8203;patri27826](https://github.com/patri27826) in [#&#8203;10184](celery/celery#10184)
- fix: clear the timer while catch the exception by [@&#8203;ChickenBenny](https://github.com/ChickenBenny) in [#&#8203;10218](celery/celery#10218)
- Prepare for release: v5.6.3 by [@&#8203;Nusnus](https://github.com/Nusnus) in [#&#8203;10221](celery/celery#10221)

#### New Contributors

- [@&#8203;maycuatroi1](https://github.com/maycuatroi1) made their first contribution in [#&#8203;10048](celery/celery#10048)
- [@&#8203;jorsyk](https://github.com/jorsyk) made their first contribution in [#&#8203;10056](celery/celery#10056)
- [@&#8203;Timour-Ilyas](https://github.com/Timour-Ilyas) made their first contribution in [#&#8203;10066](celery/celery#10066)
- [@&#8203;sueannioanis](https://github.com/sueannioanis) made their first contribution in [#&#8203;10071](celery/celery#10071)
- [@&#8203;GangEunzzang](https://github.com/GangEunzzang) made their first contribution in [#&#8203;10076](celery/celery#10076)
- [@&#8203;sbc-khacnha](https://github.com/sbc-khacnha) made their first contribution in [#&#8203;10081](celery/celery#10081)
- [@&#8203;veeceey](https://github.com/veeceey) made their first contribution in [#&#8203;10100](celery/celery#10100)
- [@&#8203;mriddle](https://github.com/mriddle) made their first contribution in [#&#8203;10086](celery/celery#10086)
- [@&#8203;Mr-Neutr0n](https://github.com/Mr-Neutr0n) made their first contribution in [#&#8203;10121](celery/celery#10121)
- [@&#8203;ChickenBenny](https://github.com/ChickenBenny) made their first contribution in [#&#8203;10108](celery/celery#10108)
- [@&#8203;bysiber](https://github.com/bysiber) made their first contribution in [#&#8203;10137](celery/celery#10137)
- [@&#8203;Rohan5commit](https://github.com/Rohan5commit) made their first contribution in [#&#8203;10139](celery/celery#10139)
- [@&#8203;cuiweixie](https://github.com/cuiweixie) made their first contribution in [#&#8203;10133](celery/celery#10133)
- [@&#8203;kelsonbrito50](https://github.com/kelsonbrito50) made their first contribution in [#&#8203;10145](celery/celery#10145)
- [@&#8203;Br1an67](https://github.com/Br1an67) made their first contribution in [#&#8203;10155](celery/celery#10155)
- [@&#8203;daniel7an](https://github.com/daniel7an) made their first contribution in [#&#8203;10103](celery/celery#10103)
- [@&#8203;drichardson](https://github.com/drichardson) made their first contribution in [#&#8203;10165](celery/celery#10165)
- [@&#8203;tsangwailam](https://github.com/tsangwailam) made their first contribution in [#&#8203;10181](celery/celery#10181)
- [@&#8203;Borzik](https://github.com/Borzik) made their first contribution in [#&#8203;10171](celery/celery#10171)
- [@&#8203;aurangzaib048](https://github.com/aurangzaib048) made their first contribution in [#&#8203;10159](celery/celery#10159)
- [@&#8203;ericbuehl](https://github.com/ericbuehl) made their first contribution in [#&#8203;10187](celery/celery#10187)
- [@&#8203;KianAnbarestani](https://github.com/KianAnbarestani) made their first contribution in [#&#8203;10192](celery/celery#10192)
- [@&#8203;patri27826](https://github.com/patri27826) made their first contribution in [#&#8203;10184](celery/celery#10184)

**Full Changelog**: <celery/celery@v5.6.2...v5.6.3>

</details>

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My45OS4wIiwidXBkYXRlZEluVmVyIjoiNDMuOTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGUiXX0=-->

See merge request swiss-armed-forces/cyber-command/cea/loom!419
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.

4 participants