mgr/prometheus: Handle empty JSON from orch get-security-config#65033
mgr/prometheus: Handle empty JSON from orch get-security-config#65033SrinivasaBharath merged 1 commit intoceph:mainfrom
Conversation
23c7557 to
c570c4d
Compare
|
PTAL |
rkachach
left a comment
There was a problem hiding this comment.
Sorry @Sunnatillo but I didn't have time to look at this issue in details. But as I can tell, the problem is not with bad json parsing (that's already being captured) but with the logging of the exception. If you check the logs you would see the error:
2025-07-27T22:54:07.624 INFO:tasks.ceph.mgr.x.smithi088.stderr:TypeError: not all arguments converted during string formatting
And this is the real problem. So basically the except Execption is working correctly but then there's another exception raised by logging sentence as the f-string formatting is not working properly with log.exception:
self.log.exception(f'Failed to setup cephadm based secure monitoring stack: {e}\n',
'Falling back to default configuration')
So the fix has to be in the logging instruction. Plz, can you try by using the following:
except Exception as e:
self.log.exception(
'Failed to setup cephadm based secure monitoring stack: %s\n'
'Falling back to default configuration',
e
)
To test quickly the changes you can fake a bad json by setting the out variable directly to an invalid json.
Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
c570c4d to
7760637
Compare
|
@rkachach @nizamial09 How should we proceed to take this in? |
|
I've marked it ready for QA. For sure this issue reproduces in the rados suite, so we can verify it with that. Not sure if other testing might be needed. |
|
Lets get this PR in |
Add patch for ceph tracker #72380 where the prometheus mgr module crashes with TypeError due to incorrect f-string usage in exception logging. Upstream fix: ceph/ceph#65033 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
Add patch for ceph tracker #72380 where the prometheus mgr module crashes with TypeError due to incorrect f-string usage in exception logging. Upstream fix: ceph/ceph#65033 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
Add patch for ceph tracker #72380 where the prometheus mgr module crashes with TypeError due to incorrect f-string usage in exception logging. Upstream fix: ceph/ceph#65033 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
Add patch for ceph tracker #72380 where the prometheus mgr module crashes with TypeError due to incorrect f-string usage in exception logging. Upstream fix: ceph/ceph#65033 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
This PR handles the empty invalid JSON errors from orch get-security-config
Fixes. https://tracker.ceph.com/issues/72380
Issue introduced by this PR: #61468
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition