Bug 462252 - Unable to set automatic date and time on non SystemD OS. (Error 4)
Summary: Unable to set automatic date and time on non SystemD OS. (Error 4)
Status: REPORTED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_clock (show other bugs)
Version: 5.25.5
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Campbell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-25 21:39 UTC by Gazi
Modified: 2023-05-14 19:59 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Rdate backend (249.39 KB, image/png)
2022-11-25 21:39 UTC, Gazi
Details
NTPDATE backend (360.06 KB, image/png)
2022-11-25 21:40 UTC, Gazi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gazi 2022-11-25 21:39:52 UTC
Created attachment 154033 [details]
Rdate backend

SUMMARY
On a machine without systemd like Gentoo, systemsettings is not able to sync time with time servers. Depending on the backend used it issues different error messages. With ntpdate backend it issues "Unable to authenticate/execute the action: 4," message, if rdate is used there is a bigger error message. Only rdate screenshot is attached the form doesn't let me attach 2 for whatever reason so the longer one it is. Both utilites work fine outside systemsettings. Both are able to set correct time. Ntpdate authorization error does not really make sense as I've tried it as a root account, as a user account with a sudo rule set, set a polkit rule for everyone to be able to use it without a password, and even set executable's permissions so that everyone can use it it doesn't really change the situation. Rdate was a little less feature full so I tested it less, however it still works just fine by itself. 

The easiest way to try it is to use Gentoo live GUI image. It comes with KDE preinstalled, however keep in mind even though it says ntpdate backend is used it is really using rdate, not sure why so you will see the rdate error message pop up.


STEPS TO REPRODUCE
1. Open systemsettings on a non SystemD OS.
2. Navigate to Regional Settings.
3. Navigate to Date & Time.
4. Change time to any other value.
5. Click apply.
6. Tick the box "Set date and time automatically"
7. Click apply.
8. Observe chaos.

OBSERVED RESULT
Error dialog pops up. The tick box is ticked but the date and time has not changed or adjusted to the correct value.

EXPECTED RESULT
Date and time change to the actual correct value occurs.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Gentoo Linux 2.9
(available in About System)
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
So the reason why this is important is that if people try KDE on Gentoo and like myself try for example using TOR Browser, they will bang their head for a while trying to figure out why the obfs bridges just hang, and apparently that's because time skew of even a few minutes does not allow for the handshake to happen. Systemsettings shows automatic time, you think it is okay but its not. Then they'd figure out it is KDE's fault and will be upset with it. I don't care I am used to it, I'd submit a patch myself but unfortunately I don't know C or C++. Sooo If you need me to do anything just say so. I will keep the system for a bit still.
Comment 1 Gazi 2022-11-25 21:40:30 UTC
Created attachment 154034 [details]
NTPDATE backend
Comment 2 Gazi 2023-05-14 19:59:07 UTC
Just decided to update this, because time module doesn't work on Systemd either. I've tested this on both my Kubuntu work machine, and my home machine. So at least since Plasma 5.24 and the bug is still present in Plasma 5.27. Funny enough never noticed that, never tried to change clock manually in Plasma. The error is different on Systemd distros (Arch, Kubuntu) it just says "unable to set current time". I will eventually try and fix it myself but maybe someone will have a look before I get a chance.