-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
selinux: Fix error reporting #18670
selinux: Fix error reporting #18670
Conversation
I locally got another "failed to delete". It says "message recipient disconnected from message bus without replying", in other words, setroubleshootd crashed. The journal just says:
so it smells like setroubleshoot has an idle timer which still fires when there's a pending D-Bus call? I mostly see this on RHEL 8 (setroubleshoot-plugins-3.3.14-1.el8 and setroubleshoot-server-3.3.26-5.el8). Same symptom in this failure, there the timing information fits:
The weather report shows that this also happens on Fedora 38. I reported this at https://bugzilla.redhat.com/show_bug.cgi?id=2112573 and added a known issue at cockpit-project/bots#4672 . I naughtied this in cockpit-project/bots#4673 In the meantime, let's fix the error reporting anyway. But let's keep the console.warn()'s, so that we can do naughty matching on it. |
b9f29e5
to
0af3e09
Compare
Exception objects are not directly printable, so trying to render it in an Alert or with `console.warn()` just results in an empty string. That makes debugging really hard, as there is no corresponding entry in the journal either. Use `.toString()` on the exception to render them properly. Also show the actual exception text in the Alert in the UI. Still keep the console.warn()s, so that we can do naughty matching on them. While at it, eliminate the unnecessary Promise wrappers, and use chaining.
0af3e09
to
a9ad7eb
Compare
.catch(ex => { | ||
console.warn("Unable to get alert for id", localId, ":", JSON.stringify(ex)); | ||
return Promise.reject(new Error(`Unable to get alert for id ${localId}: ${ex.toString()}`)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 added lines are not executed by any test. Details
.catch(ex => { | ||
console.warn("Unable to run fix:", JSON.stringify(ex)); | ||
return Promise.reject(new Error(cockpit.format(_("Unable to run fix: $0"), ex.toString()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 added lines are not executed by any test. Details
const deleteAlert = localId => client.proxy.call("delete_alert", [localId]) | ||
.then(success => { | ||
if (!success) | ||
return Promise.reject(new Error(cockpit.format(_("Failed to delete alert: $0"), localId))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test. Details
.catch(ex => { | ||
console.warn("Unable to delete alert with id", localId, ":", JSON.stringify(ex)); | ||
return Promise.reject(new Error(cockpit.format(_("Failed to delete alert: $0"), ex.toString()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 3 added lines are not executed by any test. Details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Exception objects are not directly printable, so trying to render it in
an Alert or with
console.warn()
just results in an empty string. Thatmakes debugging really hard, as there is no corresponding entry in the
journal either.
Use
.toString()
on the exception to render them properly. Also showthe actual exception text in the Alert in the UI. Still keep the
console.warn()s, so that we can do naughty matching on them.
While at it, eliminate the unnecessary Promise wrappers, and use chaining.
I'm trying to get to the bottom of this common flake. (another instance)
The screenshot just says "Unable run fix:". I didn't yet reproduce this locally, but when I run the test in a loop, it sometimes fails to delete the alert. The UI alert just says that (without a reason), and the console says:
So as the first step, let the page tell us what's actually wrong!