Skip to content

src: remove showing traceback from assert_valid_host when it fails - #60156

Merged
vshankar merged 1 commit into
ceph:mainfrom
neesingh-rh:wip-fix-traceback-issue
Apr 14, 2026
Merged

vshankar merged 1 commit into
ceph:mainfrom
neesingh-rh:wip-fix-traceback-issue

Conversation

@neesingh-rh

@neesingh-rh neesingh-rh commented Oct 7, 2024 •

Copy link
Copy Markdown
Contributor

Removed the stacktrace from command output in case of error

Fixes: https://tracker.ceph.com/issues/68420
Signed-off-by: Neeraj Pratap Singh [email protected]

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@neesingh-rh
neesingh-rh requested a review from a team as a code owner October 7, 2024 11:10
@neesingh-rh

Copy link
Copy Markdown
Contributor Author

Now the output in case of assertion error:

Error EINVAL: AssertionError: name component must include only a-z, 0-9, and -

@neesingh-rh
neesingh-rh requested a review from vshankar October 7, 2024 11:15
@neesingh-rh
neesingh-rh force-pushed the wip-fix-traceback-issue branch from 96440db to b8a0b49 Compare October 10, 2024 03:59
@neesingh-rh
neesingh-rh requested a review from a team as a code owner October 10, 2024 03:59
@neesingh-rh
neesingh-rh requested review from nizamial09 and nmunet and removed request for a team October 10, 2024 03:59
@neesingh-rh
neesingh-rh force-pushed the wip-fix-traceback-issue branch from b8a0b49 to 7f73c49 Compare October 10, 2024 03:59

@phlogistonjohn phlogistonjohn 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.

I find this extremely confusing and am concerned about the approach given that this is library code.

Why are we converting a nice specific validation exception type and just reverting it to a generic assertion error. Why do we hack in a global side effect of sys.tracebacklimit in the middle of library code? This can easily impact every piece of code running this function!

@neesingh-rh

Copy link
Copy Markdown
Contributor Author

I find this extremely confusing and am concerned about the approach given that this is library code.

Why are we converting a nice specific validation exception type and just reverting it to a generic assertion error. Why do we hack in a global side effect of sys.tracebacklimit in the middle of library code? This can easily impact every piece of code running this function!

Currently, we do have asserts which are anyways responsible for giving assertion errors and while handling that we get another SpecvalidationError which shows us the complete traceback to the users which isn't good. That's why I thought to keep the assertion error which will be actual reason for failure. Even if the caller handles the exception, we get the same traceback visible to users. Is there any better way to achieve the goal of the tracker: https://tracker.ceph.com/issues/68420

Comment thread src/pybind/mgr/mgr_util.py Resolved
Comment thread src/pybind/mgr/mgr_util.py Resolved
@github-actions

github-actions Bot commented Mar 7, 2025

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@neesingh-rh

neesingh-rh commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor Author

PR got underlooked earlier! Pushed the updates. PTAL
Error message now:

[neeraj@fedora build]$ ./bin/ceph fs volume create vol_1 vo_2
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
Error EINVAL: name component must include only a-z, 0-9, and - but got vo_2

@vshankar

Copy link
Copy Markdown
Contributor

@adk3798 @phlogistonjohn - @neesingh-rh updated the change. Mind having a look please?

@neesingh-rh

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@vshankar

vshankar commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

vshankar added a commit to vshankar/ceph that referenced this pull request Mar 16, 2026
* refs/pull/60156/head:

Reviewed-by: Adam King <[email protected]>

@vshankar vshankar 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.

@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

@vshankar

Copy link
Copy Markdown
Contributor

@neesingh-rh - can you rebase and push please?

@neesingh-rh
neesingh-rh force-pushed the wip-fix-traceback-issue branch from 1e357ec to cc0dd7e Compare March 18, 2026 09:31
@neesingh-rh

Copy link
Copy Markdown
Contributor Author

@neesingh-rh - can you rebase and push please?

Rebased

@vshankar

Copy link
Copy Markdown
Contributor

jenkins retest this please

@neesingh-rh
neesingh-rh force-pushed the wip-fix-traceback-issue branch from cc0dd7e to 5a8488b Compare March 20, 2026 07:09
Removed the stacktrace from command output in case of error
Fixes: https://tracker.ceph.com/issues/68420
Signed-off-by: Neeraj Pratap Singh <[email protected]>
@neesingh-rh
neesingh-rh force-pushed the wip-fix-traceback-issue branch from 851234f to c25b452 Compare March 24, 2026 04:35
@neesingh-rh

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@neesingh-rh

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@vshankar
vshankar dismissed phlogistonjohn’s stale review April 14, 2026 10:31

Comment addressed.

@vshankar
vshankar merged commit 9dee703 into ceph:main Apr 14, 2026
6 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/24394173613

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