Bug 16961 - polkit agent polkit-kde-authentication-agent-1 does not start intermittently
Summary: polkit agent polkit-kde-authentication-agent-1 does not start intermittently
Status: RESOLVED WORKSFORME
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 5
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Florian Hubold
QA Contact:
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-14 10:58 CEST by pat dealt
Modified: 2016-08-19 01:23 CEST (History)
5 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description pat dealt 2015-10-14 10:58:48 CEST
Description of problem:
----------------------

1- Trying to launch drakconf via KDE menu is ignored : no window for root connection is displayed as expected.

2- Trying to launch drakconf via a Konsole failed with the following error message :
[user@localhost ~]$ drakconf
==== AUTHENTICATING FOR org.mageia.drakconf.pkexec.run ===
Authentication is required to run Mageia Control Center GUI
Authenticating as: root
Password: 
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

This incident has been reported.
[[user@localhost ~]$
3- Trying to poweroff or reboot via KDE menu is ignored : nothing happens.
while running poweroff or reboot via a Konsole works perfectly.

Version-Release number of selected component (if applicable):
------------------------------------------------------------

rpm -qa --last | grep polkit
lib64polkit-gir1.0-0.113-1.1.mga5.x86_64               dim. 11 oct. 2015
lib64polkit1_0-0.113-1.1.mga5.x86_64                   dim. 11 oct. 2015 
polkit-0.113-1.1.mga5.x86_64                           dim. 11 oct. 2015
lib64gksu-polkit0-0.0.3-0.git20131130.11.mga5.x86_64   jeu. 25 juin 2015
gksu-polkit-0.0.3-0.git20131130.11.mga5.x86_64         jeu. 25 juin 2015
polkit-kde-agent-1-0.99.1-2.mga5.x86_64                jeu. 25 juin 2015
mate-polkit-1.8.0-6.mga5.x86_64                        jeu. 25 juin 2015
lib64mate-polkit1_0-1.8.0-6.mga5.x86_64                jeu. 25 juin 2015
lib64polkit-qt-core-1_1-0.112.0-6.mga5.x86_64          jeu. 25 juin 2015
lib64polkit-qt-agent-1_1-0.112.0-6.mga5.x86_64         jeu. 25 juin 2015

How reproducible:
----------------

Happens not systematically. Sometimes just after boot. Sommetimes after a while.
polkit.service status is active and Restart polkit.service doesn't solve the problem.



Reproducible: 

Steps to Reproduce:
Comment 1 David Walser 2015-10-14 18:24:58 CEST
Do you have the recent systemd update installed and have you rebooted since installing it?
David Walser 2015-10-14 23:45:30 CEST

Assignee: bugsquad => doktor5000

Comment 2 pat dealt 2015-10-15 09:40:06 CEST
 My systemd packages :

 lib64systemd0-217-11.1.mga5.x86_64   sam. 10 oct. 2015  22:42:16 CEST
 systemd-217-11.1.mga5.x86_64         sam. 10 oct. 2015  22:42:09 CEST
 systemd-units-217-11.1.mga5.x86_64   sam. 10 oct. 2015  22:42:07 CEST

and yes I rebooted several times. 

it looks like an old recurrent bug : 

 Bug 13834 -Mageia  -  polkit authorisation in remote session (vnc, x2go) 
 Bug 657006 -Redhat - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed:
             An authentication agent already exists for the given subject 

   https://bugs.mageia.org/show_bug.cgi?id=16396
   https://bugs.freedesktop.org/show_bug.cgi?id=90818
   https://bugzilla.redhat.com/show_bug.cgi?id=1243319
Comment 3 Florian Hubold 2015-10-15 21:31:54 CEST
Please don't mix up those bugs, they are all for slightly different topics.
FWIW, this is a local session on your box, you are not logged in remotely via ssh, vnc or x2go or similar, as you quoted that bug?


Please provide the output for the following commands run as your normal user:

ps -ef|grep -v grep|grep polkit
loginctl show-session $XDG_SESSION_ID


And the output as root of:

systemctl status polkit.service -a

Summary: Drakconf, poweroff and reboot run ignored. AUTHENTICATION FAILED polkit-agent-helper-1 Error : No session for cookie => Drakconf, poweroff and reboot run ignored. polkit-agent-helper-1 Error : No session for cookie
Source RPM: see below => (none)
Status: NEW => ASSIGNED
CC: (none) => doktor5000

Comment 4 Florian Hubold 2015-10-15 22:08:41 CEST
(In reply to pat dealt from comment #0)
> [user@localhost ~]$ drakconf
> ==== AUTHENTICATING FOR org.mageia.drakconf.pkexec.run ===
> Authentication is required to run Mageia Control Center GUI
> Authenticating as: root
> Password: 
> polkit-agent-helper-1: error response to PolicyKit daemon:
> GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
> ==== AUTHENTICATION FAILED ===
> Error executing command as another user: Not authorized

FWIW, just stumbled upon this upstream, noting it so I don't forget :)
https://bugs.freedesktop.org/show_bug.cgi?id=90837#c20
Comment 5 pat dealt 2015-10-16 13:58:32 CEST
Here are the results of your commands run after drakconf failed (authentication issue see description above). The issue seems to occur roughly once per 4 boots. The issue appeared 3 to 4 weeks ago after an update (which one? which package?). But for sure it was not the last polkit packages update (polkit-0.113-1.1.mga5.x86_64 ) : I had the issue before.

[user@localhost ~]#  ps -ef|grep -v grep|grep polkit
polkitd   2364     1  0 13:13 ?        00:00:00 /usr/lib/polkit-1/polkitd --no-debug
[user@localhost ~]# 

[user@localhost ~]$ loginctl show-session $XDG_SESSION_ID
Id=c1
Name=user
Timestamp=ven. 2015-10-16 13:13:41 CEST
TimestampMonotonic=34557239
VTNr=1
Display=:0
Remote=no
Service=kdm-np
Scope=session-c1.scope
Leader=1410
Audit=0
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
[user@localhost ~]$

[root@localhost ~]# systemctl status polkit.service -a
â polkit.service - Authorization Manager
   Loaded: loaded (/usr/lib/systemd/system/polkit.service; static)
   Active: active (running) since ven. 2015-10-16 13:13:54 CEST; 20min ago
     Docs: man:polkit(8)
 Main PID: 2364 (polkitd)
   CGroup: /system.slice/polkit.service
           ââ2364 /usr/lib/polkit-1/polkitd --no-debug

oct. 16 13:13:54 localhost polkitd[2364]: Started polkitd version 0.113
oct. 16 13:13:54 localhost polkitd[2364]: Loading rules from directory /etc/polkit-1/rules.d
oct. 16 13:13:54 localhost polkitd[2364]: Loading rules from directory /usr/share/polkit-1/rules.d
oct. 16 13:13:54 localhost polkitd[2364]: Finished loading, compiling and executing 5 rules
oct. 16 13:13:54 localhost polkitd[2364]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
oct. 16 13:30:49 localhost polkitd[2364]: Registered Authentication Agent for unix-process:5885:106238 (system bus name :1.126 [/usr/bin/pkexec /usr/libexec/drakconf], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
oct. 16 13:30:55 localhost polkitd[2364]: Operator of unix-process:5885:106238 FAILED to authenticate to gain authorization for action org.mageia.drakconf.pkexec.run for unix-process:5885:106238 [/usr/bin/perl /usr/bin/drakconf] (owned by unix-user:user)
oct. 16 13:30:55 localhost polkitd[2364]: Unregistered Authentication Agent for unix-process:5885:106238 (system bus name :1.126, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
[root@localhost ~]#
Comment 6 Florian Hubold 2015-10-16 20:48:36 CEST
(In reply to pat dealt from comment #5)

> [user@localhost ~]#  ps -ef|grep -v grep|grep polkit
> polkitd   2364     1  0 13:13 ?        00:00:00 /usr/lib/polkit-1/polkitd
> --no-debug
> [user@localhost ~]# 

Seems there is no polkit agent running for your user, only the polkit system daemon is running. Can you please show the output of


rpm -qa|grep -iE "polkit|policykit"
rpm -q --whatprovides polkit-agent
ps -ef|grep -v grep|grep -iE "polkit|policykit"
Comment 7 pat dealt 2015-10-17 10:54:33 CEST
Outputs of your commands :
------------------------
In both cases drakconf fails/doesn't fail (no change):
--------------------------------------------------

[user@localhost ~]$ rpm -qa|grep -iE "polkit|policykit"
lib64polkit-qt-agent-1_1-0.112.0-6.mga5
gksu-polkit-0.0.3-0.git20131130.11.mga5
lib64polkit-qt-core-1_1-0.112.0-6.mga5
mate-polkit-1.8.0-6.mga5
lib64gksu-polkit0-0.0.3-0.git20131130.11.mga5
lib64polkit1_0-0.113-1.1.mga5
lib64polkit-gir1.0-0.113-1.1.mga5
lib64mate-polkit1_0-1.8.0-6.mga5
polkit-0.113-1.1.mga5
polkit-kde-agent-1-0.99.1-2.mga5
[user@localhost ~]$ 

[user@localhost ~]$ rpm -q --whatprovides polkit-agent
mate-polkit-1.8.0-6.mga5
polkit-kde-agent-1-0.99.1-2.mga5
gnome-shell-3.14.3-8.1.mga5
[user@localhost ~]$ 

[user@localhost ~]$ rpm -qf /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1
polkit-kde-agent-1-0.99.1-2.mga5
[user@localhost ~]$ 


When drakconf works :
-------------------

[user@localhost ~]$ ps -ef|grep -v grep|grep -iE "polkit|policykit"
polkitd   2397     1  0 08:38 ?        00:00:00 /usr/lib/polkit-1/polkitd --no-debug
user   3008     1  0 08:38 ?        00:00:00 /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1
[user@localhost ~]$ 

When drakconf fails :
-------------------

[user@localhost ~]$ ps -ef|grep -v grep|grep -iE "polkit|policykit"
polkitd   2413     1  0 10:22 ?        00:00:00 /usr/lib/polkit-1/polkitd --no-debug
[user@localhost ~]$ 

You are right, there is no polkit agent running for your user in case of failure.
What is strange to me is the version of polkit-kde-agent-1-0.99.1-2.mga5 different from other package versions (112 or 113). No more recent polkit-kde-agent available in repository. 


I update my MGA5 exclusively from 
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/5/x86_64/media
Comment 8 Florian Hubold 2015-10-18 15:25:51 CEST
(In reply to pat dealt from comment #7)
> You are right, there is no polkit agent running for your user in case of
> failure.

Exactly, that is the underlying problem. Now it would be necessary to find out why it's not running. Can you attach the output as root of

journalctl -ab | grep -iE "polkit|policykit"
journalctl -ab /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1

And please have a look in the ~/.xession-errors of your user if there's anything about polkit-kde running or crashing.

> What is strange to me is the version of polkit-kde-agent-1-0.99.1-2.mga5
> different from other package versions (112 or 113). No more recent
> polkit-kde-agent available in repository. 

Why do you think it should have the same version? It's a completely different and separate software project, so it has its own version number. And there are no updates for this package.

> I update my MGA5 exclusively from 
> http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/5/x86_64/media

That is irrelevant.
Comment 9 pat dealt 2015-10-20 09:48:27 CEST
Here are your expectations :

[root@localhost ~]# journalctl -ab | grep -iE "polkit|policykit"
oct. 20 09:23:33 localhost dbus[905]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service'
oct. 20 09:23:33 localhost polkitd[2321]: Started polkitd version 0.113
oct. 20 09:23:33 localhost polkitd[2321]: Loading rules from directory /etc/polkit-1/rules.d
oct. 20 09:23:33 localhost polkitd[2321]: Loading rules from directory /usr/share/polkit-1/rules.d
oct. 20 09:23:33 localhost polkitd[2321]: Finished loading, compiling and executing 5 rules
oct. 20 09:23:33 localhost dbus[905]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
oct. 20 09:23:33 localhost polkitd[2321]: Acquired the name org.freedesktop.PolicyKit1 on the system bus
[root@localhost ~]# 


[root@localhost ~]# journalctl -ab /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1
-- Logs begin at jeu. 2015-06-25 17:00:49 CEST, end at mar. 2015-10-20 09:27:31 CEST. --
[root@localhost ~]# 


Nothing in .xsession-errors regarding polkit or polkit-kde-agent but
only when drakconf fails I have a pop-up message on startup saying :

"Erreur lors du lancement de knotify4.desktop. Soit KLauncher ne fonctionne plus, soit il ne peut pas démarrer l'application." 

And in the report of this event in .xsession-errors is :


Copyright (c) 2001-13 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:127: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
ksmserver(2336): Couldn't start knotify from knotify4.desktop:  "Erreur lors du lancement de knotify4.desktop. Soit KLauncher ne fonctionne plus, soit il ne peut pas démarrer l'application." 

Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
KGlobal::locale(): Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work
[31;01merror: Unable to find hp-upgrade --notify on PATH.[0m
krunner(2820) KDevelopSessions::KDevelopSessions: INIT KDEV 
I/O warning : failed to load external entity "/home/user/.qalculate/eurofxref-daily.xml"
I/O warning : failed to load external entity "/home/user/.qalculate/eurofxref-daily.xml"
kwin(2396) KWin::GlxBackend::present: 
It seems you are using the nvidia driver without triple buffering
You must export __GL_YIELD="USLEEP" to prevent large CPU overhead on synced swaps
Preferably, enable the TripleBuffer Option in the xorg.conf Device
For this reason, the tearing prevention has been disabled.
See https://bugs.kde.org/show_bug.cgi?id=322060
 
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address
Error creating textual authentication agent: Error opening current controlling terminal for the process (`/dev/tty'): No such device or address

(process:4725): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

(process:4747): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
[calBackendLoader] Using libical backend at /mnt/Data/Courrier/rtz5v3iy.default/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/libical-manifest
Vector smash protection is enabled.
plasmapackage:/ui/NotificationDelegate/NotificationDelegate.qml:209:21: QML TextEdit: Boucle potentielle dÃÂétectÃÂée dans les ancres pour le remplissage.
plasmapackage:/ui/NotificationDelegate/NotificationDelegate.qml:163:13: QML Item: Boucle d'association dÃÂétectÃÂée pour la propriÃÂétÃÂé ÃÂëÃÂàheightÃÂàÃÂû
plasmapackage:/ui/NotificationDelegate/NotificationDelegate.qml:163:13: QML Item: Boucle d'association dÃÂétectÃÂée pour la propriÃÂétÃÂé ÃÂëÃÂàheightÃÂàÃÂû
file:///usr/lib64/kde4/imports/org/kde/plasma/components/TabBar.qml:150:5: QML Item: Boucle potentielle dÃÂétectÃÂée dans les ancres pour le remplissage.
file:///usr/lib64/kde4/imports/org/kde/plasma/components/TabBar.qml:150:5: QML Item: Boucle potentielle dÃÂétectÃÂée dans les ancres pour le remplissage.
dolphin(5007) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Warning: Service printers defines a print command, but rameter is ignored when using CUPS libraries.
"
Comment 10 Florian Hubold 2015-10-20 21:35:02 CEST
The xsession excerpts seem completely irrelevant, apart from the ksmserver message at the beginning.


@Luc: Is it safe to uninstall polkit-kde-agent-1 with --nodeps to replace it by another polkit agent for temporary testing purposes? And can you have a look, maybe you have an idea why sometimes /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1 is not running intermittently, and how to debug that.

CC: (none) => lmenut, mageia

Florian Hubold 2015-10-20 21:41:29 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=16577

Florian Hubold 2015-12-11 14:25:15 CET

URL: (none) => https://bugs.freedesktop.org/show_bug.cgi?id=90837
Summary: Drakconf, poweroff and reboot run ignored. polkit-agent-helper-1 Error : No session for cookie => polkit agent polkit-kde-authentication-agent-1 does not start intermittently

Comment 11 Thierry ANIEL 2016-02-13 11:50:04 CET
(In reply to pat dealt from comment #0)
> Description of problem:
> ----------------------
> 
> 1- Trying to launch drakconf via KDE menu is ignored : no window for root
> connection is displayed as expected.
> 
> 2- Trying to launch drakconf via a Konsole failed with the following error
> message :
> [user@localhost ~]$ drakconf
> ==== AUTHENTICATING FOR org.mageia.drakconf.pkexec.run ===
> Authentication is required to run Mageia Control Center GUI
> Authenticating as: root
> Password: 
> polkit-agent-helper-1: error response to PolicyKit daemon:
> GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
> ==== AUTHENTICATION FAILED ===
> Error executing command as another user: Not authorized
> 
> This incident has been reported.
> [[user@localhost ~]$
> 3- Trying to poweroff or reboot via KDE menu is ignored : nothing happens.
> while running poweroff or reboot via a Konsole works perfectly.
> 
> Version-Release number of selected component (if applicable):
> ------------------------------------------------------------
> 
> rpm -qa --last | grep polkit
> lib64polkit-gir1.0-0.113-1.1.mga5.x86_64               dim. 11 oct. 2015
> lib64polkit1_0-0.113-1.1.mga5.x86_64                   dim. 11 oct. 2015 
> polkit-0.113-1.1.mga5.x86_64                           dim. 11 oct. 2015
> lib64gksu-polkit0-0.0.3-0.git20131130.11.mga5.x86_64   jeu. 25 juin 2015
> gksu-polkit-0.0.3-0.git20131130.11.mga5.x86_64         jeu. 25 juin 2015
> polkit-kde-agent-1-0.99.1-2.mga5.x86_64                jeu. 25 juin 2015
> mate-polkit-1.8.0-6.mga5.x86_64                        jeu. 25 juin 2015
> lib64mate-polkit1_0-1.8.0-6.mga5.x86_64                jeu. 25 juin 2015
> lib64polkit-qt-core-1_1-0.112.0-6.mga5.x86_64          jeu. 25 juin 2015
> lib64polkit-qt-agent-1_1-0.112.0-6.mga5.x86_64         jeu. 25 juin 2015
> 
> How reproducible:
> ----------------
> 
> Happens not systematically. Sometimes just after boot. Sommetimes after a
> while.
> polkit.service status is active and Restart polkit.service doesn't solve the
> problem.
> 
> 
> 
> Reproducible: 
> 
> Steps to Reproduce:

I experience the same problem described above on 13/02/2016, and resolve the issue this (user) way :

+ delete the .dbus folder in my home directory and restart the session !

CC: (none) => thierry.aniel

Comment 12 pat dealt 2016-02-17 15:54:15 CET
Thanks for your feedback.

On my side, this bug has vanished for a while without updating any *polkit* package (they are still with the versions listed in first description) nor removing .dbus folder.

I assume that it had nothing to do with polkit but rather "polkit" data or environment.

By the way, I updated in the meantime a lot of other packages including kernel and dbus ones.

I suggest to consider this bug as closed.
Comment 13 Florian Hubold 2016-02-17 20:55:30 CET
(In reply to pat dealt from comment #12)
> On my side, this bug has vanished for a while without updating any *polkit*
> package (they are still with the versions listed in first description) nor
> removing .dbus folder.
> 
> I assume that it had nothing to do with polkit but rather "polkit" data or
> environment.
> 
> By the way, I updated in the meantime a lot of other packages including
> kernel and dbus ones.
> 
> I suggest to consider this bug as closed.

Closing then.

Status: ASSIGNED => RESOLVED
Resolution: (none) => WORKSFORME

Comment 14 maximus zeebra 2016-08-19 01:23:34 CEST
In case anyone else has polkit issues I suggest doing the following:

urpmi --replacepkgs --clean lib64mate-polkit1_0 lib64polkit-gir1.0 lib64polkit-qt-agent-1_1 lib64polkit-qt-core-1_1 lib64polkit1_0 mate-polkit polkit polkit-kde-agent-1

----------------------------------

Also solved this issue:
Error launching /usr/share/applications/mageia-drakconf.desktop. Either KLauncher is not running anymore, or it failed to start the application.

And the main issue:
==== AUTHENTICATING FOR org.mageia.draknetcenter.pkexec.run ===
Authentication is required to run Mageia Network Center
Authenticating as: user
Password: 
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

This incident has been reported.

CC: (none) => kfjellda


Note You need to log in before you can comment on or make changes to this bug.