Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934314 - LXDE with sys-auth/polkit-124-r1 Cannot determine session the caller is in/Interactive Authentication Required
Summary: LXDE with sys-auth/polkit-124-r1 Cannot determine session the caller is in/In...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords: PMASKED, PullRequest
Depends on:
Blocks:
 
Reported: 2024-06-14 18:24 UTC by fjmccloud
Modified: 2025-03-07 21:21 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fjmccloud 2024-06-14 18:24:33 UTC
After recent monthly (June) emerge --sync/emerge -puDN world
2 problems observed in LXDE desktop.

1.  Upon logging into LXDE desktop always greeted with an ominous error window
 GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine session the caller is in
2.  Upon attempting to use "start menu" -> Logout -> reboot or shutdown options it complains about
InteractiveAuthorizationRequired: Interactive Authentication Required

Otherwise everything operates fine.  The desktop works, and rebooting from the command line is fine.

This problem did not exist in my May emerges, where I switched to the 23.0 split-usr desktop profile.  At that time the polkit version was polkit-123.


Subsequently, downgrading to sys-auth/polkit-123 fixes the problem.
The conclusion is that something is very broken in sys-auth/polkit-124-r1.
I don't know how to debug it further as the entire interplay of polkit/elogind/dbus is a huge mystery.  I don't configure any scripts for it.


All related documentation about the status of the problem, including emerge --info, groups, .xinitrc, proc fstab entry, loginctl, XDG env vars is present on the forum here:
https://forums.gentoo.org/viewtopic-p-8830222.html#8830222
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-21 14:59:36 UTC
You mention you were using binpkgs -- it's therefore possible it was bug 920383, although 100% convinced.

I don't see any obvious differences in the commits (upstream even) for 123 vs 124-r1.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-21 15:11:26 UTC
Looking at https://github.com/polkit-org/polkit/compare/123...124 again but I don't spot anything obvious.

I suppose you could try revert individual commits as there's not many, and it's easier than setting up bisect here I suspect.
Comment 3 Tomas Johansson 2024-06-23 19:50:06 UTC
Hi!

After upgrading to polkit-124-r1, i was unable to restart/shutdown computer from within xfce. Manual restart/shutdown as root was only way.
Downgrading to polkit-123 solved the problem.

Somehow i think this i related.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-04 00:00:33 UTC
I think need someone to try do that backport/revert approach, tbh, given I can't reproduce and I can't even see anything that would be related yet..
Comment 5 Fab 2024-08-11 10:06:56 UTC
Hi,                                                                                                    
                                                                                                       
I'm not a polkit expert, but reading the polkit source code by searching the :

  « Cannot determine session the caller is in »

string leads me to the following function¹ :

  polkit_backend_session_monitor_get_session_for_subject

which seems to return NULL, meaning that a DBus request through g_dbus_connection_call_sync failed and returned NULL.

I would try to start the polkitd DBus service without the « --no-debug » flag² to see if polkitd service is saying anything useful in logs.


PS: Note that I am on a stable system with Xfce and polkit-124-r1, and I do not have any problem.

1. https://github.com/polkit-org/polkit/blob/main/src/polkitbackend/polkitbackendsessionmonitor.c#L377
2. /usr/share/dbus-1/system-services/org.freedesktop.PolicyKit1.service
Comment 6 mfld.fr 2024-08-12 20:02:02 UTC
Hello, same issue here, that time with XFCE4 power manager: the suspend, reboot and power off buttons are grayed. Downgrading from sys-auth/polkit 124 to 123 makes the buttons to work again.
Comment 7 Andreas Sturmlechner gentoo-dev 2024-08-29 16:57:55 UTC
Please upgrade to sys-auth/elogind-252.9-r2 at the same time with sys-auth/polkit-124-r1 and try again.
Comment 8 mfld.fr 2024-08-31 17:12:01 UTC
Tested after upgrading polkit & elogind to suggested versions:
mfld@home /mnt/data/home/mfld $ equery l polkit
 * Searching for polkit ...
[IP-] [  ] sys-auth/polkit-124-r1:0
mfld@home /mnt/data/home/mfld $ equery l elogind
 * Searching for elogind ...
[IP-] [  ] sys-auth/elogind-252.9-r2:0

Buttons "Sleep", "Power off" and "Restart" are grayed. That upgrade did not solve the problem.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-31 23:55:43 UTC
I'll add a live ebuild but I'll need you to "bisect" manually with it. I'll provide instructions.
Comment 10 Larry the Git Cow gentoo-dev 2024-09-01 00:18:40 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=134134a25808d0a3e14409a813d88aa29901e9f7

commit 134134a25808d0a3e14409a813d88aa29901e9f7
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-01 00:17:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-01 00:17:39 +0000

    sys-auth/polkit: add 9999
    
    Add a live ebuild to allow bisecting and testing. Note that this works
    with current git master (obviously) so I'll need to do tweaks by
    adding a temporary 9999-r1 for people to test with in the bug.
    
    Bug: https://bugs.gentoo.org/934314
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/polkit/polkit-9999.ebuild | 157 +++++++++++++++++++++++++++++++++++++
 1 file changed, 157 insertions(+)
Comment 11 Larry the Git Cow gentoo-dev 2024-09-01 00:27:16 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86c8c4d4ba5c7965a12d6afadd048af80ece6dde

commit 86c8c4d4ba5c7965a12d6afadd048af80ece6dde
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-01 00:26:09 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-01 00:26:09 +0000

    sys-auth/polkit: add 9999-r1
    
    As promised in 134134a25808d0a3e14409a813d88aa29901e9f7. This ebuild
    will be removed once the bug is figured out, as it's a horrible hack
    with nasty forced-patching-but-ignoring-errors to allow bisecting
    betwen 123 and 124.
    
    Bug: https://bugs.gentoo.org/934314
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/polkit/polkit-9999-r1.ebuild | 159 ++++++++++++++++++++++++++++++++++
 1 file changed, 159 insertions(+)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-01 00:30:43 UTC
OK.

If you can hit this bug, please do the following as soon as possible:
0) Try polkit-125. If it fails, continue. If it works, please tell us, but consider following the below to help us possibly backport a fix quickly.

1) Upgrade to polkit-124. Make sure it fails so we have a bad baseline.

2) EGIT_OVERRIDE_COMMIT_POLKIT_ORG_POLKIT=c49c68e1738837fe4fa38184b20e2773098fc672 ebuild "$(portageq get_repo_path / gentoo)"/sys-auth/polkit/polkit-9999-r1.ebuild clean install merge

   This SHOULD work because it is supposed to be identical to polkit-123. Please make sure everything works fine.

3) EGIT_OVERRIDE_COMMIT_POLKIT_ORG_POLKIT=4b7a5c35fb3dd439e490f8fd6b1265d17c6d4bcb ebuild "$(portageq get_repo_path / gentoo)"/sys-auth/polkit/polkit-9999-r1.ebuild clean install merge

   This tries the next commit. If it works still, continue. If it fails now, please tell us.

4) Repeat using each commit ID from the top to the bottom from https://github.com/polkit-org/polkit/compare/123...124. You can get the ID by clicking the link and looking at the URL.

This should help us identify which commit breaks things.
Comment 13 Larry the Git Cow gentoo-dev 2024-09-02 02:26:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e221ed6c0979b6297d8ec40b1e41552d60f85ac

commit 8e221ed6c0979b6297d8ec40b1e41552d60f85ac
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-09-02 02:25:41 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-09-02 02:25:41 +0000

    sys-auth/polkit: improve 9999-r1 hacks
    
    We want to work with elogind for all commits we test. We don't care about this test
    ebuild working with systemd, so hacky sed it is.
    
    Bug: https://bugs.gentoo.org/923614
    Bug: https://bugs.gentoo.org/934314
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/polkit/polkit-9999-r1.ebuild | 1 +
 1 file changed, 1 insertion(+)
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-02 07:38:15 UTC
We may have had a breakthrough with Uros' testing at https://bugs.gentoo.org/923614#c13. I am looking more later.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-02 07:38:36 UTC
(In reply to Sam James from comment #14)
> We may have had a breakthrough with Uros' testing at
> https://bugs.gentoo.org/923614#c13. I am looking more later.

Confirmation of results is very welcome.
Comment 16 mfld.fr 2024-09-08 14:42:44 UTC
Step: 0) Try polkit-125. If it fails, continue. If it works, please tell us, but consider following the below to help us possibly backport a fix quickly.
Result: it still fails (with elogind-246.10-r4).
Now continuing with step 1)...
Comment 17 mfld.fr 2024-09-08 16:13:20 UTC
Step: 1) Upgrade to polkit-124. Make sure it fails so we have a bad baseline.
Result: it fails

Step: 2) it works

Step: 3) bisect on polkit commits 123-124:
00: c49c68e1738837fe4fa38184b20e2773098fc672: PASS
06: 1d1cdb3896f1160346f3dd2c07ca3ba01f129431: PASS
07: 7f0d792323cdca70b3d581cc9ed54df3d844a637: FAIL <---
08: 8cabb1183aea59ccff125d0e2367fe5c8ac50b62: FAIL
12: 95c381977865d02d7fb955c540489daab394dd0f: FAIL

Double-check:
06: 1d1cdb3896f1160346f3dd2c07ca3ba01f129431: PASS
07: 7f0d792323cdca70b3d581cc9ed54df3d844a637: FAIL <---

So it fails starting with commit https://github.com/polkit-org/polkit/commit/7f0d792323cdca70b3d581cc9ed54df3d844a637
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-15 10:29:06 UTC
Thank you all, I'll look more when I'm back in a few days.
Comment 19 Larry the Git Cow gentoo-dev 2024-11-10 13:12:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e13b2238a22208eab1a24fe839fd61b81b3acb2

commit 8e13b2238a22208eab1a24fe839fd61b81b3acb2
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-11-10 13:09:56 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-11-10 13:09:56 +0000

    profiles: mask >=sys-auth/polkit-124 on non-systemd profiles
    
    >=polkit-124 breaks suspend on elogind systems and I haven't been able
    to get to the bottom of it, so mask for now.
    
    Bug: https://github.com/polkit-org/polkit/issues/451
    Bug: https://bugs.gentoo.org/923614
    Bug: https://bugs.gentoo.org/934314
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/package.mask            | 5 +++++
 profiles/targets/systemd/package.mask | 8 ++++++++
 2 files changed, 13 insertions(+)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2f9f5170ef6f65713d7c9e86501a8388d9d8d6f

commit b2f9f5170ef6f65713d7c9e86501a8388d9d8d6f
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-11-10 13:06:43 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-11-10 13:06:58 +0000

    Revert "sys-auth/polkit: drop 123"
    
    This reverts commit a8d1fdb294af26b3ba1797886ab9f1e49867ef73.
    
    Needed for elogind.
    
    Bug: https://bugs.gentoo.org/923614
    Bug: https://bugs.gentoo.org/934314
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-auth/polkit/Manifest                           |   1 +
 sys-auth/polkit/files/polkit-123-mozjs-JIT.patch   |  36 +++++
 .../files/polkit-123-pkexec-uninitialized.patch    |  35 +++++
 sys-auth/polkit/polkit-123.ebuild                  | 162 +++++++++++++++++++++
 4 files changed, 234 insertions(+)
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-26 02:52:16 UTC
Upstream are struggling to reproduce it in e.g. our livegui image: https://github.com/polkit-org/polkit/issues/451#issuecomment-2678342553.

Could someone affected by it try replicate their setup in a VM, and perhaps share it? (Or describe in full the steps they took to get there)
Comment 21 Alec Kloss 2025-03-07 21:14:38 UTC
FYI, I have pipewire problems with polkit-125-r1 in that nothing can connect to pipewire.  Downgrading to 1.23-r1 fixes for me.  This is a new install with systemd and plasma.
Comment 22 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-07 21:21:21 UTC
(In reply to Alec Kloss from comment #21)
> FYI, I have pipewire problems with polkit-125-r1 in that nothing can connect
> to pipewire.  Downgrading to 1.23-r1 fixes for me.  This is a new install
> with systemd and plasma.

Thanks, but I think that may well be worth a new bug.