View previous topic :: View next topic |
Author |
Message |
strelok-84 n00b
Joined: 22 Nov 2022 Posts: 6
|
Posted: Tue Nov 22, 2022 8:42 pm Post subject: KDE Systemsettings time ERROR 4 |
|
|
Hi,
I am new to Gentoo wanted to give it a shot. Like it so far. One issue I am having and can't seem to resolve is that every time I try to change system time, it returns this error Code: | Unable to authenticate/execute the action: 4 | .
It doesn't seem to be Polkit related, I've written a rule to allow change without authentication and even before the password prompt window would always come up and the error would appear after authentication. I tried to monitor what happens on dbus but its the same as what is happening with my Kubuntu work machine, nothing out of the ordinary(and it works there so). If I launch systemsettings from the terminal the only message that I see is Code: | Timedated not found, using legacy saving mode | which I think is fine because as far as I know that's something to do with systemd and I am trying OpenRC here. I've looked for any info online and all I've found were two forum posts dating back to 2010 and the info there was not really helpful. If any logs are required just tell me what to submit Thanks a lot for reading this far, if you could help I would be very grateful |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Tue Nov 22, 2022 11:32 pm Post subject: |
|
|
Welcome to Gentoo!
Why do you want to change the time?
Is it wrong?
Have you ever set the timezone of your system during initial config?
Plz
Post or check that
Code: |
ls -l /etc/localtime
|
points to your timezone.
If not
Code: |
rm /etc/localtime
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime # please choose your own
emerge -av net-misc/ntp
ntpdate pool.ntp.org
|
Does this solve the issue? _________________
|
|
Back to top |
|
|
strelok-84 n00b
Joined: 22 Nov 2022 Posts: 6
|
Posted: Tue Nov 22, 2022 11:55 pm Post subject: |
|
|
Hi, thank you, and thanks a lot for replying. I initially wanted to adjust time because tor browser would not connect to obsf bridges. Apparently if the time is off even by a few minutes it will just hang. Didn't know that.
I can set the time through terminal but I guess I am just trying to figure out what I did wrong or misconfigured that I get errors. I can manually set time okay its just when I tick the Quote: | set the date and time automatically | or change ntp server that I get this error 4.
I did go through the timezone configuration the output for:
Code: | ls -l /etc/localtime |
is
Code: | /etc/localtime -> /usr/share/zoneinfo/Europe/Moscow |
I tried the steps below(even with London selected) sadly does not resolve the issue. I do however get this error when I type in the last line
Code: | 23 Nov 02:58:34 ntpdate[30153]: the NTP socket is in use, exiting |
I think it is something to do with ntp permissions? Not sure really. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Wed Nov 23, 2022 12:32 am Post subject: |
|
|
Quote: |
23 Nov 02:58:34 ntpdate[30153]: the NTP socket is in use, exiting
|
This means you either have ntpd or chronyd running.
Try
Code: |
rc-service ntpd stop
rc-service chronyd stop
ntpdate pool.ntp.org
|
_________________
|
|
Back to top |
|
|
strelok-84 n00b
Joined: 22 Nov 2022 Posts: 6
|
Posted: Wed Nov 23, 2022 9:56 am Post subject: |
|
|
Yes, it works now! But the error is still there, yesterday I tried doing it with -u flag works as well without stopping ntpd and chronyd, however when I try to run
Code: | ntpdate pool.ntp.org |
as a user it gives me an error
Code: | 23 Nov 12:48:56 ntpdate[31912]: bind() fails: Permission denied |
so it has to either be done with sudo or root, maybe that's the issue? Systemsettings is probably running a similar command and doesn't get the permission to do so? Is there a way to allow ntpdate to be run by a user or say a "wheel" group user?
EDIT:
However what is odd is that if I run systemsettings from the root account it still generates the same error so maybe that's not the issue |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Wed Nov 23, 2022 10:35 am Post subject: |
|
|
For example I see in
Code: |
sudo ls -l /run/chrony/chronyd.sock -->
srwxr-xr-x 1 ntp ntp 0 Nov 23 11:57 /run/chrony/chronyd.sock
|
the sock is owned by the ntp user and group
Try
Code: |
visudo -->
username ALL= NOPASSWD: /usr/sbin/ntpdate
|
or change the perms of the socket --not practical
or have ntpd run as a different user by editing
/etc/conf.d/ntpd
Code: |
NTPD_OPTS="-g -u <your-user>"
|
_________________
|
|
Back to top |
|
|
strelok-84 n00b
Joined: 22 Nov 2022 Posts: 6
|
Posted: Wed Nov 23, 2022 2:16 pm Post subject: |
|
|
Sorry, got hit with QTWebengine and Office update, takes a while not used to that
I tried that, which seems that it should allow me to execute ntpdate, however same error
Code: | 23 Nov 17:04:47 ntpdate[3198]: bind() fails: Permission denied |
which means my intial logic was wrong. Maybe ntpdate is using some other binary or specifically that "bind" function that is outside of ntpdate and the user doesn't have permission to use that, not sure. Just in case I will post what happens on dbus when I press apply:
Code: | method call time=1669212719.007564 sender=:1.42 -> destination=org.freedesktop.DBus serial=90 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
string "org.kde.polkit-kde-authentication-agent-1"
method return time=1669212719.007584 sender=org.freedesktop.DBus -> destination=:1.42 serial=27 reply_serial=90
boolean true
method call time=1669212719.007871 sender=:1.42 -> destination=org.kde.polkit-kde-authentication-agent-1 serial=91 path=/org/kde/Polkit1AuthAgent; interface=org.kde.Polkit1AuthAgent; member=setWIdForAction
string "org.kde.kcontrol.kcmclock.save"
uint64 75497478
method return time=1669212719.008187 sender=:1.15 -> destination=:1.42 serial=15 reply_serial=91
method call time=1669212719.031273 sender=:1.42 -> destination=org.freedesktop.DBus serial=92 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
string "type='signal',path='/Config',interface='org.kde.knotification',member='reparseConfiguration'"
method call time=1669212719.038326 sender=:1.34 -> destination=org.freedesktop.DBus serial=16 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
string "org.freedesktop.ReserveDevice1.Audio3"
uint32 5
signal time=1669212719.038345 sender=org.freedesktop.DBus -> destination=(null destination) serial=28 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string "org.freedesktop.ReserveDevice1.Audio3"
string ""
string ":1.34"
signal time=1669212719.038353 sender=org.freedesktop.DBus -> destination=:1.34 serial=29 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string "org.freedesktop.ReserveDevice1.Audio3"
method return time=1669212719.038359 sender=org.freedesktop.DBus -> destination=:1.34 serial=30 reply_serial=16
uint32 1 |
However what's interesting is that if I deselect ntp and use rdate instead(it was listed as another possible backend in the help menu) the error is different, it just sort of hangs, I will post an error message just in case as well:
Code: | Unable to authenticate/execute the action: 8, DBus Backend error: could not contact the helper. Connection error: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.. Message error: |
Also the terminal outputs this:
Code: | kf.auth: "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken." |
perhaps unrelated.
Will need to investigate |
|
Back to top |
|
|
strelok-84 n00b
Joined: 22 Nov 2022 Posts: 6
|
Posted: Thu Nov 24, 2022 9:59 pm Post subject: |
|
|
Well, I did try a few things, systemsettings has no issue setting date and time manually. So changing timezones is a non issue, changing time and date is a non issue. However the moment it is trying to sync time with an ntp server it has some sort of a permission error 4. I tried using 'visudo' and it works of course, but there is an issue if systemsettings is not using sudo, then the permission denied error will still pop up. I chmoded the binary "/usr/sbin/ntpdate" to allow anyone to use it and it does let me use it and set date and time as any user but systemsettings still does not tick the "set date and time automatically". Kind of out of options since I can't read C++ can't really look into the systemsettings source code to see what its doing exactly, perhaps a bug in KDE on non systemd OSs? Because ntpdate command sets the date just fine by itself. Seems systemsettings does not interact with it correctly? |
|
Back to top |
|
|
strelok-84 n00b
Joined: 22 Nov 2022 Posts: 6
|
Posted: Fri Nov 25, 2022 8:42 pm Post subject: |
|
|
I remembered that Gentoo has a live GUI image for installation and its KDE + OpenRC. Sadly the behavior is consistent. I doubt the maintainers would misconfigure the environment. Gives out the same error as when rdate backend is used and pretty much the same if you force it to use ntpdate. Its certainly a bug, gotta learn C Will try and submit it to KDE. |
|
Back to top |
|
|
|