Skip to content

mgr/dashboard: skip the table when an nvmeof cli result has no columns - #69659

Merged
idryomov merged 1 commit into
ceph:mainfrom
tchaikov:wip-dashboard-prettytable
Jun 23, 2026
Merged

idryomov merged 1 commit into
ceph:mainfrom
tchaikov:wip-dashboard-prettytable

Conversation

@tchaikov

@tchaikov tchaikov commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

The dashboard leaves prettytable unpinned. prettytable commit prettytable/prettytable@2574492 ("Apply some Pylint rules (PLR)", #436) rewrote _stringify_row()'s row_height as max(_get_size(c)[1] for c in row), which raises ValueError("max() iterable argument is empty") on a row with no cells. The change is undocumented and shipped in 3.18.0; get_string() trips on it when a table has a row but no columns.

AnnotatedDataTextOutputFormatter builds such a table for an empty result, or one whose only field is status or error_message, so NvmeofCLICommand.call() returns -EINVAL and the command fails. This broke run-tox-mgr-dashboard-py3 once the tox virtualenv picked up prettytable 3.18.0.

Return an empty string when there are no columns instead of formatting a degenerate table.

Fixes: https://tracker.ceph.com/issues/77589

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@tchaikov
tchaikov requested a review from a team as a code owner June 23, 2026 05:42
@tchaikov tchaikov moved this from New to Review in progress in Ceph-Dashboard Jun 23, 2026
@nizamial09
nizamial09 requested a review from Hezko June 23, 2026 05:55
@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Ceph-Dashboard Jun 23, 2026

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

Thanks @tchaikov

The dashboard leaves prettytable unpinned.  prettytable commit 2574492 ("Apply
some Pylint rules (PLR)", ceph#436) rewrote _stringify_row()'s row_height as
`max(_get_size(c)[1] for c in row)`, which raises ValueError("max() iterable
argument is empty") on a row with no cells.  The change is undocumented and
shipped in 3.18.0; get_string() trips on it when a table has a row but no
columns.

AnnotatedDataTextOutputFormatter builds such a table for an empty result, or
one whose only field is status or error_message, so NvmeofCLICommand.call()
returns -EINVAL and the command fails.  This broke run-tox-mgr-dashboard-py3
once the tox virtualenv picked up prettytable 3.18.0.

Return an empty string when there are no columns instead of formatting a
degenerate table.

Fixes: https://tracker.ceph.com/issues/77589
Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov force-pushed the wip-dashboard-prettytable branch from 87808d0 to 9dd7fd0 Compare June 23, 2026 07:46
@tchaikov

Copy link
Copy Markdown
Contributor Author

changelog

  • update test to accommodate the change.

@nizamial09 and @afreen23 could you take another look?

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

LGTM

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

Im currently working on a PR which will show a empty message like "no listeners" text instead of the empty table, I hope you will like it when its ready :)

@tchaikov

tchaikov commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Im currently working on a PR which will show a empty message like "no listeners" text instead of the empty table, I hope you will like it when its ready :)

that's probably a better UX. but i am wondering if we should treat this message as errors and send them to stderr, or.. probably not -- i am not sure.

@idryomov

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@idryomov
idryomov merged commit b4f29b3 into ceph:main Jun 23, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard Jun 23, 2026
@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/28018857737

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

The dashboard leaves prettytable unpinned.

Does that mean that this PR should be backported? At least to the umbrella branch, but I think ceph nvmeof CLI is there in tentacle as well?

@tchaikov
tchaikov deleted the wip-dashboard-prettytable branch June 23, 2026 12:51
@tchaikov

Copy link
Copy Markdown
Contributor Author

The dashboard leaves prettytable unpinned.

Does that mean that this PR should be backported? At least to the umbrella branch, but I think ceph nvmeof CLI is there in tentacle as well?

both. updated https://tracker.ceph.com/issues/77589.

@idryomov

Copy link
Copy Markdown
Contributor

both. updated https://tracker.ceph.com/issues/77589.

@tchaikov Will you be creating backport PRs? make check jobs on tentacle and umbrella PRs remain affected.

@tchaikov

Copy link
Copy Markdown
Contributor Author

both. updated https://tracker.ceph.com/issues/77589.

@tchaikov Will you be creating backport PRs? make check jobs on tentacle and umbrella PRs remain affected.

i will try to get to it tomorrow. if it's super urgent, please feel free to take them.

@tchaikov

Copy link
Copy Markdown
Contributor Author

both. updated https://tracker.ceph.com/issues/77589.

@tchaikov Will you be creating backport PRs? make check jobs on tentacle and umbrella PRs remain affected.

i will try to get to it tomorrow. if it's super urgent, please feel free to take them.

should be ready. please let me know if i am missing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants