Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: kandalf on June 11, 2020, 09:51:57 AM

Title: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: kandalf on June 11, 2020, 09:51:57 AM
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?
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: Sandeep 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.
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: kandalf 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.
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: Igor S. 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
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed - Fix
Post by: NFT on July 15, 2020, 06:58:41 AM
Do not "disable secure processes" fix the real reason, Solution, test on 2 updated CentOS 7 with CWP
https://access.redhat.com/solutions/1543343 (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
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: cinique 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.
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: idovecer on May 16, 2022, 09:35:27 AM
Also tnx to the @NFT,
solved also by my side.

Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: idovecer 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.

Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: daniellopesjp 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/
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: emar 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!
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: overseer on February 01, 2023, 04:11:31 PM
I can validate this fix also. Thanks!
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: novooriente@gmail.com on April 19, 2023, 08:07:20 PM
works for me too
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: vipony12 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

Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: internetdunyam 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
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: changlee 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.
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: emar on June 07, 2023, 07:28:52 PM
I think this issue has returned,

After running sh /scripts/update_cwp

ERROr Ajax: Error
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: bullten on June 07, 2023, 07:54:15 PM
mount proc -o remount,hidepid=0
systemctl restart polkit.service
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: changlee on June 08, 2023, 07:40:17 AM
The last year I face many update CWP PRO problems. For each server I ask paid support. This is not trusty.
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: xuanbinhco on July 29, 2023, 12:31:19 AM
The error "Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject" is related to the PolicyKit1 service, which manages permissions and access privileges on systems based on Linux. This error occurs when PolicyKit1 cannot determine the subject user, which can lead to permission issues.

Here are some possible solutions to fix this problem:

Verify User: Make sure you are logged in with a valid user account and that the user has the appropriate permissions to access the PolicyKit1 service. If you're using a GUI, make sure you've entered your username and password correctly.

Check PolicyKit1 permissions: Make sure PolicyKit1 configuration files have the correct permissions. PolicyKit1 configuration files are usually located in the /etc/polkit-1/ or /usr/share/polkit-1/ directory. Check if the files are readable and writable for the correct users.

Restart the service: Try restarting the PolicyKit1 service to see if that resolves the issue. You can use the following command depending on your operating system:

For distributions using systemd:


sudo systemctl restart polkit
For distros using Upstart:

sudo service polkit restart
Check system logs: Check the system logs for more information about the specific error that is occurring. System logs may be in the /var/log/ directory and relevant files may include syslog, auth.log, or polkit.log.

Check disk space: Sometimes a lack of disk space can lead to unexpected errors. Make sure you have enough disk space available on your system.

Update the system: Make sure your operating system is up to date with the latest updates and patches. Sometimes errors can be fixed by system updates.

If none of the above steps resolves the problem, there may be a more complex problem specific to your system. In this case, it may be worth contacting your operating system's technical support or searching online forums and discussions for further assistance.
Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: max on August 17, 2023, 12:14:52 PM
I have had this same problem which I think started after I installed cwp_2fa and run centos 7 then did a centos 7 update. After I removed the cwp_2fa I now have a bigger problem 404 page index is missing. /login/index.php

run sh /scripts/update_cwp won't fix it.

Title: Re: Polkit error - GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed
Post by: overseer on August 17, 2023, 10:37:10 PM
Do you mind starting your own thread to address your particular problem? It seems off-topic to the Polkit error addressed in this thread.