GNOME Bugzilla – Bug 687556
polKitAgent: Don't crash when we cannot enable/disable the auth agent
Last modified: 2013-02-19 19:29:08 UTC
See patch.
Created attachment 228013 [details] [review] polKitAgent: Don't crash when we cannot enable/disable the auth agent This makes it easier to run with jhbuild.
Review of attachment 228013 [details] [review]: Do we expect such failures? Under what circumstances can they happen? If not, then logError is more appropriate. If yes, having the error message appended to the log is still useful.
(In reply to comment #2) > Review of attachment 228013 [details] [review]: > > Do we expect such failures? Under what circumstances can they happen? > If not, then logError is more appropriate. If yes, having the error message > appended to the log is still useful. I don't expect them to happen "in the wild" i.e outside of jhbuild configurations.
Created attachment 228027 [details] [review] polKitAgent: Don't crash when we cannot enable/disable the auth agent This makes it easier to run with jhbuild. --- Use logError instead of just log.
We shouldn't just be dropping polkit on the floor -- why is it failing, and if so, how can we make it not fail?
(In reply to comment #5) > We shouldn't just be dropping polkit on the floor -- why is it failing, and if > so, how can we make it not fail? Probably because stuff isn't suid root in the jhbuild env (didn't debug just a guess) .. the thing is this is just for jhbuild it should not happen in the real world ... and even if it does no auth dialogs is still better then outright crashing.
I'm not sure this is strictly related to missing setuid binaries... I have a jhbuild install setup and I have both of the appropriate pk binaries marked as setuid (pkexec and the agent helper). I still see this in my session.log: (gnome-shell:6505): Gvc-WARNING **: Failed to connect context: Connection refused JS ERROR: !!! Exception was: Polkit.Error: No session for pid 6505 JS ERROR: !!! message = '"No session for pid 6505"' JS ERROR: !!! fileName = '"/opt/ca/desrt/gnome-3.8/share/gnome-shell/js/ui/components/polkitAgent.js"' JS ERROR: !!! lineNumber = '329' JS ERROR: !!! stack = '"0 anonymous()@/opt/ca/desrt/gnome-3.8/share/gnome-shell/js/ui/components/polkitAgent.js:329 1 wrapper()@/opt/ca/desrt/gnome-3.8/share/gjs-1.0/lang.js:204 2 anonymous("name" = ""polkitAgent"")@/opt/ca/desrt/gnome-3.8/share/gnome-shell/js/ui/components/__init__.js:56 3 wrapper(""polkitAgent"")@/opt/ca/desrt/gnome-3.8/share/gjs-1.0/lang.js:204 4 anonymous("name" = ""polkitAgent"", 1, [object Array])@/opt/ca/desrt/gnome-3.8/share/gnome-shell/js/ui/components/__init__.js:22 5 anonymous()@/opt/ca/desrt/gnome-3.8/share/gnome-shell/js/ui/components/__init__.js:21 6 wrapper()@/opt/ca/desrt/gnome-3.8/share/gjs-1.0/lang.js:204 7 anonymous()@/opt/ca/desrt/gnome-3.8/share/gnome-shell/js/ui/components/__init__.js:13 8 wrapper()@/opt/ca/desrt/gnome-3.8/share/gjs-1.0/lang.js:204 9 anonymous()@/opt/ca/desrt/gnome-3.8/share/gjs-1.0/lang.js:145 10 anonymous()@/opt/ca/desrt/gnome-3.8/share/gjs-1.0/lang.js:239 11 start()@/opt/ca/desrt/gnome-3.8/share/gnome-shell/js/ui/main.js:150 12 <TOP LEVEL>@<main>:1 "' Window manager warning: Log level 32: Execution of main.js threw exception: Polkit.Error: No session for pid 6505 gnome-session[6287]: WARNING: App 'gnome-shell.desktop' respawning too quickly gnome-session[6287]: WARNING: Detected that screensaver has left the bus
actually, maybe my polKitAgent crash is just different from yours...
In any case, I can confirm that the patches here make the issue go away for me (I just applied the javascript one to my already-installed gnome-shell but I assume that the other one would work equally well).
Right, that's just because we get back an error and then drop it on the floor. I think it's worthwhile to instead fix whatever's generating that error. I'm going to assume it's a PolKit/ConsoleKit bug around tracking sessions, since you certainly should have a session.
Pretty sure I know what the issue is -- my polkit is built against libsystemd-login but my system is using ConsoleKit... Trying to figure out what I should do about this...
Pushed with log() instead of logError after IRC review. Attachment 228027 [details] pushed as dd6fe58 - polKitAgent: Don't crash when we cannot enable/disable the auth agent
I think outright crashing is better than no auth dialogs, to be honest. We need to fix jhbuild so it Just Works on all systems.
(In reply to comment #13) > I think outright crashing is better than no auth dialogs, to be honest. We need > to fix jhbuild so it Just Works on all systems. Unfortunately, and trust me I gave this a lot of thought, that's just not always possible. It's a technological dead end, albeit one quite useful for what it does do. However, it still could make sense to add hacks to the system code where it does help out jhbuild. In this case for example, we could do: if (GLib.getenv("CERTIFIED_GNOMIE")) { try { doSomething(); } catch (e) { logError(e); } } else { doSomething(); }