Skip to content

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

Open
neesingh-rh wants to merge 1 commit intoceph:mainfrom
neesingh-rh:wip-fix-traceback-issue
Open

src: remove showing traceback from assert_valid_host when it fails #60156
neesingh-rh wants to merge 1 commit intoceph:mainfrom
neesingh-rh:wip-fix-traceback-issue

Conversation

@neesingh-rh
Copy link
Contributor

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

Removed the stacktrace from command output in case of error

Fixes: https://tracker.ceph.com/issues/68420
Signed-off-by: Neeraj Pratap Singh neesingh@redhat.com

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
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
Copy link
Contributor

@phlogistonjohn phlogistonjohn left a comment

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
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

@github-actions
Copy link

github-actions bot commented Mar 7, 2025

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.

@github-project-automation github-project-automation bot moved this from Review in progress to Done in Ceph-Dashboard Jul 2, 2025
@neesingh-rh neesingh-rh reopened this Jan 5, 2026
@neesingh-rh neesingh-rh force-pushed the wip-fix-traceback-issue branch from ce5298e to f3bacea Compare January 21, 2026 10:33
@github-actions github-actions bot added cephadm cephfs Ceph File System labels Jan 21, 2026
@neesingh-rh
Copy link
Contributor Author

neesingh-rh commented Jan 21, 2026

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
Contributor

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

@neesingh-rh
Copy link
Contributor Author

jenkins retest this please

@vshankar
Copy link
Contributor

vshankar commented Mar 4, 2026

This PR is under test in https://tracker.ceph.com/issues/75334.

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

Reviewed-by: Adam King <adking@redhat.com>
Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

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

@vshankar
Copy link
Contributor

jenkins retest this please

@vshankar
Copy link
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
Contributor Author

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

Rebased

@vshankar
Copy link
Contributor

jenkins retest this please

Removed the stacktrace from command output in case of error
Fixes: https://tracker.ceph.com/issues/68420
Signed-off-by: Neeraj Pratap Singh <neesingh@redhat.com>
@neesingh-rh neesingh-rh force-pushed the wip-fix-traceback-issue branch from cc0dd7e to 5a8488b Compare March 20, 2026 07:09
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