Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
KDE Systemsettings time ERROR 4
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
strelok-84
n00b
n00b


Joined: 22 Nov 2022
Posts: 6

PostPosted: Tue Nov 22, 2022 8:42 pm    Post subject: KDE Systemsettings time ERROR 4 Reply with quote

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 :D Thanks a lot for reading this far, if you could help I would be very grateful :D
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Tue Nov 22, 2022 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
strelok-84
n00b
n00b


Joined: 22 Nov 2022
Posts: 6

PostPosted: Tue Nov 22, 2022 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Nov 23, 2022 12:32 am    Post subject: Reply with quote

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
View user's profile Send private message
strelok-84
n00b
n00b


Joined: 22 Nov 2022
Posts: 6

PostPosted: Wed Nov 23, 2022 9:56 am    Post subject: Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Nov 23, 2022 10:35 am    Post subject: Reply with quote

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
View user's profile Send private message
strelok-84
n00b
n00b


Joined: 22 Nov 2022
Posts: 6

PostPosted: Wed Nov 23, 2022 2:16 pm    Post subject: Reply with quote

Sorry, got hit with QTWebengine and Office update, takes a while not used to that :lol:

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 :D
Back to top
View user's profile Send private message
strelok-84
n00b
n00b


Joined: 22 Nov 2022
Posts: 6

PostPosted: Thu Nov 24, 2022 9:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
strelok-84
n00b
n00b


Joined: 22 Nov 2022
Posts: 6

PostPosted: Fri Nov 25, 2022 8:42 pm    Post subject: Reply with quote

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 :D Will try and submit it to KDE.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum