Date and Uptime increment rapidly

Status
Not open for further replies.

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
FreeNAS 8.0.2 release.

Date displayed in System Information kept incrementing at an alarming rate: it went from Nov 14 2012 (which was already bogus, of course) to Mar 23 2013 in less than 10 minutes, and Uptime now is claimed to be 541 days.

I reset the date and time from the console, and the Date now displays correctly, but Uptime still shows 541 days.
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
I rebooted and checked that the date and time shown in the BIOS were correct, but the FreeBSD date command still showed a date several days ahead. I reset the date and time from the command line, but now it now shows:

System Time Sun Dec 18 00:45:52 2011
Uptime 12:45AM up 42 days, 1:07, 0 users
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
And now it reports:

System Time Sat Dec 31 15:34:18 2011
Uptime 3:34PM up 55 days, 15:56, 0 users
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
In the GUI on the System ->Settings page are settings for NTP (Time) servers. Make sure there are entries there and make sure you have proper DNS setup. Those settings and the ntp daemon should be keeping your system clock locked in.
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
The Time servers are:

0.freebsd.pool.ntp.org iburst maxpoll 9
1.freebsd.pool.ntp.org iburst maxpoll 9
2.freebsd.pool.ntp.org iburst maxpoll 9

DNS is:

192.168.1.1

(This is the router address, and it is shown as the DNS address when I execute ipconfig on a Windows machine.)

The Time and Uptime are now:

System Time Sat Dec 17 02:48:08 2011
Uptime 2:48AM up 50 days, 7:50, 0 users
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Can you try pinging those time servers from the command line?

Also add a secondary DNS server, maybe like opendns 208.67.222.222, or Google's opendns 8.8.8.8
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
Can you try pinging those time servers from the command line?

I was able to ping 0.freebsd.pool.ntp.org but not the others. I have now replaced one of the others by

nist.expertsmi.com

Also add a secondary DNS server, maybe like opendns 208.67.222.222, or Google's opendns 8.8.8.8

I added both of those, and the date and time were fine for the next few hours, but this morning I see:

System Time Fri Jan 6 12:47:18 2012
Uptime 12:47PM up 81 days, 1:59, 0 users

At the console I now see many reports, some two or three days apart, of the form

<date and time> freenas upsmon[1739]: Poll UPS [ups] failed - Server disconnected

then:

Nov 24 01:40:02 freenas upsmon[1739]: Poll UPS [ups] failed - Write error: Broken Pipe
Nov 24 02:37:00 freenas ntpd[13383]: time correction of -947893 seconds exceeds sanity limit (1000); set clock manually to the correct UTC time.

then another bunch of the upsmon error messages.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
This probably isn't an NTP thing. Now and then you'll run into some hardware that's, uh, goofy.

Try posting the results of

> sysctl kern.timecounter.hardware
kern.timecounter.hardware: HPET

for us. Or just try playing with it. Your possible choices are

> sysctl kern.timecounter.choice
kern.timecounter.choice: TSC(-100) HPET(900) ACPI-safe(850) i8254(0) dummy(-1000000)

You can then change to (on my system) TSC, HPET, ACPI-safe, i8254, or dummy. You can use "sysctl -w kern.timecounter.hardware=foo" to change settings. Find which one makes your clock run sanely. Report back.
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
I know this suggestion doesn't make much sense, but would replacing the battery on the motherboard be worth a shot - there's usually a button battery on most motherboards to keep the the real time clock going when mains power is removed. Could a duff battery be causing the clock to "glitch"?

PC clocks are highly inaccurate at the best of times, but never quite this bad unless something else is causing the time to reset...

I doubt the UPS monitor errors are related, and nothing to worry about unless of course you expect to depend on UPS power and a clean shutdown in the event of power loss.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
No. The CMOS clock is read at boot, after that point, it's FreeBSD that is handling the clock. That's what allows things like adjtime(2) to work. You can't slew a hardware clock, well, not without constantly puttering with it at least. And that's a draggy slow operation. You don't want to putter with the CMOS clock any more than you need to. In fact, as long as you have Internet and(/or) NTP available, you can get by just fine without accurate CMOS time.

Replacing the motherboard battery periodically is more important just to make sure your machine is able to boot without getting hung up on "CMOS options incorrect, press F1 to continue" when you reboot after 1500 days of uptime.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
This probably isn't an NTP thing. Now and then you'll run into some hardware that's, uh, goofy.

Try posting the results of

> sysctl kern.timecounter.hardware
kern.timecounter.hardware: HPET

for us. Or just try playing with it. Your possible choices are

> sysctl kern.timecounter.choice
kern.timecounter.choice: TSC(-100) HPET(900) ACPI-safe(850) i8254(0) dummy(-1000000)

You can then change to (on my system) TSC, HPET, ACPI-safe, i8254, or dummy. You can use "sysctl -w kern.timecounter.hardware=foo" to change settings. Find which one makes your clock run sanely. Report back.

@Jgrego, I think you're right about this. I had forgotten about it because the symptoms are a little different, I had posted about it before. Some motherboards you need to go into the BIOS and disable HPET (High Percision Event Timer). On my system the errors weren't the system time (at least that I noticed), but I was getting errors in the log about LARGE adjustments in seconds, like +/- 30000 or more seconds.

Z300M, check your BIOS settings for that setting, HPET and disable it, that fixed it for me. Somtimes it's not labeled HPET but spelled out like I described above.

EDIT: I added this question to the FAQ because I remember when I had the problem it took awhile to find the solution and it's been asked here before.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Actually, that's premature. It'd be better to find out what was causing the problems with the existing configuration before making changes.
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
@Jgrego, I think you're right about this. I had forgotten about it because the symptoms are a little different, I had posted about it before. Some motherboards you need to go into the BIOS and disable HPET (High Percision Event Timer). On my system the errors weren't the system time (at least that I noticed), but I was getting errors in the log about LARGE adjustments in seconds, like +/- 30000 or more seconds.

Z300M, check your BIOS settings for that setting, HPET and disable it, that fixed it for me. Somtimes it's not labeled HPET but spelled out like I described above.

EDIT: I added this question to the FAQ because I remember when I had the problem it took awhile to find the solution and it's been asked here before.

I couldn't find an HPET setting on this motherboard (an Asus F1A75-V Pro), but I recalled that I had recently updated the BIOS from 1103 to 1501 (which had enabled the machine to boot with an IDE card installed; with the 1103 BIOS it would simply hang with a cursor blinking in the top left corner). Reverting to the 1103 BIOS has cured this date-and-time-problem and also the absence of the usage graphs that I reported in the Noobs forum. Of course I have had to remove the IDE card again, but I'll just have to live without those old small drives until Asus comes up with a non-crappy BIOS.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I'm not sure whether to say "sorry to hear it" or "great". But at least you know the trouble now. ;-)
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
Another new BIOS has appeared: ver. 1602. The usage graphs are back, and an external drive attached to the USB 3.0 port now works (it didn't with 1103), but although the time seemed to be OK for the 8hrs or so I kept an eye on it during the day, it still advanced 1hr and 20min overnight -- but that's far less than with the 1501 BIOS. The attempt to reset the clock automatically (at 4:48am) failed because the required adjustment (-4799 seconds) was too great ("insane").

I am wondering whether, although I found no HPET setting in the BIOS, some change I did make might have affected that. So I am thinking that maybe I should reset all the BIOS options to the default, then change only what I have to, such as switching the SATA ports from IDE to AHCI and setting the default boot device.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I am wondering whether, although I found no HPET setting in the BIOS, some change I did make might have affected that. So I am thinking that maybe I should reset all the BIOS options to the default, then change only what I have to, such as switching the SATA ports from IDE to AHCI and setting the default boot device.

Yes, you'll need to recheck all of your BIOS settings. I just found an upgrade for my BIOS and after the upgrade HPET was enabled. I decided to leave it on and see if it was working better, but ended up with the same problem again, I ended up disabling it again. I also had AHCI enabled which SEEMED stable until recently, after switching the SATA ports to IDE everything is back to normal. Hmmmmm.....
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
Yes, you'll need to recheck all of your BIOS settings. I just found an upgrade for my BIOS and after the upgrade HPET was enabled. I decided to leave it on and see if it was working better, but ended up with the same problem again, I ended up disabling it again. I also had AHCI enabled which SEEMED stable until recently, after switching the SATA ports to IDE everything is back to normal. Hmmmmm.....

I reset the BIOS defaults and changed only SATA IDE to AHCI, NumLock On to Off, and set the boot device priority. When FreeNAS 8.0.2 had finished booting, I saw that the time was 5 hours ahead, so I reset it from the console. I then sat and watched a whole string of UPS-related error messages, each one with a date and time at least several hours (and sometimes more than a day) later than the previous one -- all within the space of a few minutes -- messages such as:

"Server disconnected"
"Write error: broken pipe"
"Data stale"

I then had to go out, and when I came back about three hours later it had got to Jan 8 2012. I unplugged the cable to the UPS, then plugged it in again -- no more error messages, and so far the time is still OK.
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
I reset the BIOS defaults and changed only SATA IDE to AHCI, NumLock On to Off, and set the boot device priority. When FreeNAS 8.0.2 had finished booting, I saw that the time was 5 hours ahead, so I reset it from the console. I then sat and watched a whole string of UPS-related error messages, each one with a date and time at least several hours (and sometimes more than a day) later than the previous one -- all within the space of a few minutes -- messages such as:

"Server disconnected"
"Write error: broken pipe"
"Data stale"

I then had to go out, and when I came back about three hours later it had got to Jan 8 2012. I unplugged the cable to the UPS, then plugged it in again -- no more error messages, and so far the time is still OK.

For a long time the date and time stayed OK. but after I had shut it down and restarted it again I got several of the UPS-related messages accompanied by time advances. I disconnected and reconnected the UPS signal cable again, and for two days everything was OK -- with no UPS-related messages. Then this morning I saw that there had been another UPS "server disconnected" message at a reported time of 03:21:13. At 7am or so, when I checked, it was approx. 20 minutes fast.

I have the distinct impression that these time advances are somehow related to the UPS function.
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
For a long time the date and time stayed OK. but after I had shut it down and restarted it again I got several of the UPS-related messages accompanied by time advances. I disconnected and reconnected the UPS signal cable again, and for two days everything was OK -- with no UPS-related messages. Then this morning I saw that there had been another UPS "server disconnected" message at a reported time of 03:21:13. At 7am or so, when I checked, it was approx. 20 minutes fast.

I have the distinct impression that these time advances are somehow related to the UPS function.

Confirmed: Over a period of more than a week, I have observed that every time there is one of these UPS-related "events" the time advances by 20 minutes.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Confirmed: Over a period of more than a week, I have observed that every time there is one of these UPS-related "events" the time advances by 20 minutes.

Wow, that's pretty messed up, thanks for figuring that out. There's going to be an updated version of NUT in the 8.0.3 release, hopefully that'll help. 8.0.3 RC1 is available now if you want to give it a try:

http://sourceforge.net/projects/freenas/files/FreeNAS-8.0.3/
 
Status
Not open for further replies.
Top