Skip to content
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

Don't crash on start-up if polkit encounters a dbus error #12549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SparkyBluefang
Copy link
Contributor

From #12272

Don't crash if the agent doesn't start properly. If another agent happens to be running, this will throw a DBus exception. I figured popping a notification would be most appropriate, since the user may have another agent configured to auto-start.

(cinnamon:9337): Gjs-CRITICAL **: 13:47:05.571: JS ERROR: Polkit.Error: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject
_init@/usr/share/cinnamon/js/ui/polkitAuthenticationAgent.js:332:22
AuthenticationAgent@/usr/share/cinnamon/js/ui/polkitAuthenticationAgent.js:323:10
init@/usr/share/cinnamon/js/ui/polkitAuthenticationAgent.js:392:17
start@/usr/share/cinnamon/js/ui/main.js:433:31
@<main>:1:47

This was my best guess at how to handle this. I wasn't sure if it belonged in polkitAuthenticationAgent.js or in main.js.

…claimed. Alert the user they may need to disable an alternate agent.
@clefebvre
Copy link
Member

Do you have a quick way of reproducing this?

@clefebvre clefebvre self-assigned this Dec 3, 2024

Main.warningNotify(_('Unable to start Cinnamon PolicyKit Agent'), err.message +
"\n\n" +
_("If you have another PolicyKit Agent configured to autostart, it should be disabled."),
Copy link
Member

Choose a reason for hiding this comment

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

should be "agent", not "Agent".

icon_type: St.IconType.FULLCOLOR,
icon_size: 36 });

Main.warningNotify(_('Unable to start Cinnamon PolicyKit Agent'), err.message +
Copy link
Member

Choose a reason for hiding this comment

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

'Unable to start the PolicyKit agent'

@clefebvre
Copy link
Member

Actually, I wonder if we should show a dialog or just log the issue...

This could be done on purpose by the user to force a GTK agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants