Author Topic: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed  (Read 30380 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
I have multiple servers and I have updated 2 of them, now I have the same error on both everytime I tried to restart any service.

I get the following error:
Code: [Select]
Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)

Why we get this error? And what is the solution?

Offline
*****
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #1 on: June 12, 2020, 07:07:24 AM »
this is not any error ots some issue with new version of centos 7.8 you can disable secure processes to suppress this message.

Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #2 on: June 12, 2020, 01:45:10 PM »
this is not any error ots some issue with new version of centos 7.8 you can disable secure processes to suppress this message.
How can I disable secure processes?

And why this is not an error? This cause that some processes cannot restart and if they stop we are unable to start it, I think the system should not work like that.

Offline
*****
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #3 on: June 16, 2020, 01:52:31 PM »
This is CentOS bug and seems like they will not fix it :(
https://bugs.centos.org/view.php?id=17291
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Do not "disable secure processes" fix the real reason, Solution, test on 2 updated CentOS 7 with CWP
https://access.redhat.com/solutions/1543343

Resolution:

    Ensure the existence of a polkitd system user & group
    Copy/paste the following 2 compound-commands to a root terminal to check for and conditionally create the user/group
   
Code: [Select]
getent group polkitd >/dev/null && echo -e "\e[1;32mpolkitd group already exists\e[0m" || { groupadd -r polkitd && echo -e "\e[1;33mAdded missing polkitd group\e[0m" || echo -e "\e[1;31mAdding polkitd group FAILED\e[0m"; }
    getent passwd polkitd >/dev/null && echo -e "\e[1;32mpolkitd user already exists\e[0m" || { useradd -r -g polkitd -d / -s /sbin/nologin -c "User for polkitd" polkitd && echo -e "\e[1;33mAdded missing polkitd user\e[0m" || echo -e "\e[1;31mAdding polkitd user FAILED\e[0m"; }

    Reset the permissions and user/group ownership for all files provided by the polkit and polkit-pkla-compat packages
    Copy/paste the following compound-command to a root terminal to check for and conditionally reset user/group perms & ownership
   
Code: [Select]
rpm -Va polkit\* && echo -e "\e[1;32mpolkit* rpm verification passed\e[0m" || { echo -e "\e[1;33mResetting polkit* rpm user/group ownership & perms\e[0m"; rpm --setugids polkit polkit-pkla-compat; rpm --setperms polkit polkit-pkla-compat; }
    Reboot
    A reboot of the machine will be required to make sure that all changes take affect and that polkit has reconnected to the dbus
   
Code: [Select]
shutdown -r now

Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #5 on: July 15, 2020, 08:24:06 AM »
I hereby declare @NFT the winner!  ;D

A simpler method (mount modification) was posted a while back that appears to have cleared the warning. As to whether it is/was effective, is another matter.
« Last Edit: July 15, 2020, 08:28:13 AM by cynique »

Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #6 on: May 16, 2022, 09:35:27 AM »
Also tnx to the @NFT,
solved also by my side.


Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #7 on: June 02, 2022, 08:03:39 AM »
Also tnx to the @NFT,
solved also by my side.

Just notice,
temporally solved.

Problem still exists, yesterday I noticed the same message for crond :(.

Is there any solution?! It seems that there is existing problem with CentOS 7.6, even on 7.8.
It doesn’t look promising that the RedHat team will address this any time soon.


Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #8 on: June 04, 2022, 06:18:10 PM »
On centos 7, there are instances where you get the error Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)

This usually happens when trying to restart a systemd service.

The workaround is as follows:

Code: [Select]
groupadd -g 23 nohidproc
usermod -a -G nohidproc polkitd
mount -o remount,rw,hidepid=2,gid=nohidproc /proc
systemctl restart polkit

Add the following in /etc/fstab as well

Code: [Select]
echo "proc /proc proc defaults,hidepid=2,gid=nohidproc 0 0" >> /etc/fstab
After mount the new mountpoint

Code: [Select]
mount -a
Code: [Select]
systemctl restart polkit
Done.


https://www.awaludin.net/how-to-fix-gdbus-errororg-freedesktop-policykit1-error-failed-centos-7/

Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #9 on: February 01, 2023, 05:10:15 AM »
I can confirm @daniellopesjp solution just worked for me.

Now I can run sh /scripts/update_cwp without these two warnings:

Code: [Select]
Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)

Thanks!

Offline
*****
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #10 on: February 01, 2023, 04:11:31 PM »
I can validate this fix also. Thanks!

Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #11 on: April 19, 2023, 08:07:20 PM »
works for me too

Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #12 on: May 06, 2023, 11:34:50 PM »
I got error
Code: [Select]
svxxx.xxx polkitd[9231]: Unregistered Authentication Agent for unix-process:9501:31436 (system bus name :1.37, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.
Any help for me?
I can't start apache


Offline
*
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #13 on: May 18, 2023, 08:41:59 PM »
this is not any error ots some issue with new version of centos 7.8 you can disable secure processes to suppress this message.

thank you

Offline
**
Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
« Reply #14 on: June 07, 2023, 05:19:59 AM »
Hello,
I am not able to securely mount my CWP disks. Problem do remains and it is not good for a PRO panel.
You may use our FREE SMTP Newsletter APP at https://www.emailbat.com