Skip to content

Everything breaks when the time is wrong

Just had a weird experience with a bunch of systemd stuff and my system time being off.

I turned on my computer as normal, and everything booted fine. I tried to update my computer as I usually do but for some reason I couldn't connect to the AUR. Googled it to figure out why and the Arch forums and Arch wiki weren't working either. Good god. That was how I fixed everything. Actually, a lot of websites weren't working. The DNS wasn't resolving. Resolved was rejecting responses because of DNSSEC or something.

Turns out my system time was off by like 9 hours. I had let the battery in my laptop fully drain earlier which I never usually do. That's weird though, I thought. Surely timesyncd would have fixed that at bootup. Turns out it couldn't even resolve the IP addresses of my NTP servers because the time was off. This seems dumb af to me even still. Anyway, to fix it I had to disable NTP, manually set the time, re-enable NTP to get accurate time and then everything worked after that.

Just wanted to share my experience. I'm surprised I could even manage to fix it without the Arch wiki and forums. ๐Ÿ™ƒ

Also, is there any less fragile setup I can use?

4 points15 comments
Open on Reddit
About this post
Posted
Archived
Score
4 ยท 100% up
Kind
Text
ID
bpsrpy

Author

3
posts
13
comments
2
media
View profile

15 comments

I would suggest setting up an NTP "master" on your local network (with a static IP), and have your other machines refer to that by IP. Then you will not have to worry about DNS issues.

3 points

This seems like a good idea. I've always wanted to set up a GPS clock before so I might do some weird GPS Raspberry Pi NTP server.

1 points

I get this as well when I let my battery run out. Most ntp solutions are designed to slowly make your clock in sync and not do a jump. I use chrony for my ntp client and I have to force it to skew my clock by many hours with the makestep option. There may be a similar option for your ntp client. Time is used in the tls handshake, so websites that leverage https are also affected.

1 points

That's, well, bad? Your computer has a CMOS battery so it should never loose the time.

2 points

Just make sure that timedatectl shows the ntp service: active and clock syncronized: yes

Usually time out of sync can break your certificates, which is why your websites/updates didn't work.

When my laptop is powered off, the CMOS battery loses time in 4 minutes. After that it resets to January 2008. On a fresh boot, because of ntp, its usually the right time by the time I'm logged back in since it can still grab ethernet or wireless. I usually just suspend it because of that.

1 points

Well, your laptop shouldn't loose the time as RTC is powered by CMOS battery.

1 points

When NTP breaks, manually set the time or ask a public NTP server.

It sounds like you're delivering NTP or DNS over SSL and experiencing the fallout of SSL breaking.

Less fragile setup

Resolve the NTP servers you use and add them to your hosts file or directly use the IP address not domain name. This way you do not need to query DNS to update time.

Tldr: Time been out breaks SSL your name resolution requires SSL thus no names can resolve. Put your NTP server in hosts so you dont use DNS to look it up.

1 points
unknown author7 hidden

Good job. But seriously, why would anyone use NTP except in the case that internal clock is broken?

Also, is there any less fragile setup I can use?

Local time?

-3 points

Internal clocks always experience drift. NTP (or an equivalent technology, such as TAI64) is essential, especially on any machine that is connected to an external network.

6 points

Well, my local time is fragile too if I can't have my battery drain without it going off by nine hours.

I also use NTP because the clocks in my computer's drift over time.

1 points

That sounds like you have a misconfigured something: If your CMOS battery was dead, then the time should reset to a fixed point in time, often 1.1.1970, but some firmware goes for a later date.

Are you writing local time into your bios on shutdown and then getting UTC out on boot?

Linux usually puts UTC into the BIOS while windows stores local time. So switching between Linux an windows can have this effect.

In that case you should also configure Linux to use local time. That is way simpler than switching that in windows.

2 points

Check your CMOS battery? Internal clock is not powered by the main batteries (at least it shouldn't be).

1 points

You probably use NTP (ntpd) and dont realise it.

Right now, go check for the presence of these services running on your machine.

Local time

You realise that just refers to using geolocation to set timezone and daylight savings right?

1 points
unknown author

You probably use NTP (ntpd) and dont realise it.

Right now, go check for the presence of these services running on your machine.

Looks like I don't use NTP after all.

You realise that just refers to using geolocation to set timezone and daylight savings right?

Yes.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

โ†orโ†’
Previous / next file
โ†‘orโ†“
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.