Server Time jumped forward 12 hours.

westhost-neil

Well-Known Member
Jun 3, 2005
48
0
156
UK
I had a lot of complaints this morning from customers saying that emails & orders are being sent with the wrong date.

When I looked the servers time was set 12 hours in advance. Further investigation showed that the change occured at 2.15am which is exactly the same time that /scripts/upcp gets run.

So I've synced the server time and also synced it to the hardware clock (which was an hour out) but how can I be sure this won't happen again?

I've checked the timezone but it's impossible to know what it was set on as it just shows the first entry in the dropdown. Anyway I've updated this with the correct time zone now but would like to know what the cause might be.

Does upcp do a timesync when it runs, could it be that the timezone was set incorrectly, if so why did this only happen today. Is it something to do with the clocks going back at the weekend?

Any help would be appreciated.

Neil
 

nbento

Member
Jan 5, 2006
19
0
151
Im having the same problem.
Care to explauin what you did because no matter what I always end up with 10 hours in advance.
I also did a sync tiem on the server everything gets ok but 1 minute later it drives back to 10 hours.
 

westhost-neil

Well-Known Member
Jun 3, 2005
48
0
156
UK
Hi,

I didn't do much to sort my problem out as it wasn't as bad as the problem your having.

I had a feeling the system clock was out so I ran:

/sbin/hwclock --hctosys
This changed the system time to one hour ahead. So in cPanel I resynced the time and made sure it was correct then I ran

/sbin/hwclock --systohc
This set the hardware clock to the correct time.

Have you checked to see if you have a cronjob that runs every minute that may be altering the time. Also change the timezone to the correct one, I don't know a way of checking the current timezone so I just set it what it should be.

Hope that helps
 

mooony

Well-Known Member
Nov 9, 2002
82
0
156
I had the same problem this morning.

To fix it I did this:

login into WHM. Server Configuration -> Server Time

Now select your time zone and update it. Once you did this you go back and do sync time. Now you server is synced.

The only big problem is that all the log files are messed up. Is there a way to clean them up?

Thanks Ronald
 

nbento

Member
Jan 5, 2006
19
0
151
I had the same problem this morning.

To fix it I did this:

login into WHM. Server Configuration -> Server Time

Now select your time zone and update it. Once you did this you go back and do sync time. Now you server is synced.

The only big problem is that all the log files are messed up. Is there a way to clean them up?

Thanks Ronald
Thats what I tried in the first place but it doesnt work.
I change the timezone to my time, it reloads fine, but when I check again Im again on Africa time zone.
If I sync the time it sync well, but when you check again Im again on africa time zone.
This is weird.
 

westhost-neil

Well-Known Member
Jun 3, 2005
48
0
156
UK
I change the timezone to my time, it reloads fine, but when I check again Im again on Africa time zone.
I don't think that means it's set to Africa, mine says the same. I'm sure the dropdown selection is done, but it doesn't select it when you reload the page.
 

nbento

Member
Jan 5, 2006
19
0
151
I found the problem on another thread here

Run this on the shell prompt
rdate -s rdate.cpanel.net

But now my logs are all messed up and I have 5 sites that are dependent fromthe stats.

Any idea on how to fix this?
I mean awstats still show 12 hours ahead, alhtough the server is ok now
 

gantz

Registered
Oct 2, 2006
2
0
151
france
All the same for me.

And it's really disturbing for my vB where all messages are messed up, since last posts are shown as posted TONIGHT, so actual posts with real time are thrown away in the middle of the topics instead of beeing considered as last ones.

How did that happen ?!
What could be done ?!
 

gemininetcom

Active Member
Nov 29, 2003
36
0
156
Found this morning same problem. I did update/sync in WHM Server Time, as Moony also did. The screwup of logfiles does not have an easy solution, unless you want to correct all manually. I figured just to leave it. /var/log/messages and /var/log/secure are sequentially written to anyway, so if you read thru them, you quickly notice the 12hr jump and jump back when I sync-ed time. However, it does not solve the problem that /scripts/upcp screwed it up and can do it again unless cPanel staff figures out what went wrong :D
 

westhost-neil

Well-Known Member
Jun 3, 2005
48
0
156
UK
This only happened on one of my servers. Running WHM 10.8.0 cPanel 10.9.0-C56.

Have another server in the same location running the same version that was unaffected.

Only difference, the one that was affected is running Red Hat ES 3 and the unaffected one is running Fedora Core 4.
 
Last edited:

Pyrix

Member
Dec 21, 2003
6
0
151
cPanel really need to look into this - it screwed up the site on our server so we had to turn it off and is a pointless waste of my time when i have to good hour or two running queries to try and get all the posts in our vBulletin forum and gallery back to where they should be!

For those with vB forums or Photopost galleries that were affected - if you can find the ids of the last and first posts affected you can run the following queries:

vB Posts:
UPDATE post SET dateline = dateline - 43200 WHERE postid <= ID OF LAST AFFECTED POST and postid >= ID OF FIRST AFFECTED POST

Then you'll need to update your thread and forum counters in the vBulletin Admin CP

Photopost Photos:
UPDATE photos SET date = date - 43200 WHERE id <= ID OF LAST AFFECTED POST and id >= ID OF FIRST AFFECTED POST

Photopost Comments:
UPDATE comments SET date = date - 43200 WHERE id <= ID OF LAST AFFECTED POST and id >= ID OF FIRST AFFECTED POST

I post these with no guarantee that they won't blow your server up, ruin your forum, steal your girlfriend, kill your fish etc! I recommend you do a backup and do a SELECT first to make sure you're affecting the right entries the database!

EG: SELECT * FROM post WHERE postid <= ID OF LAST AFFECTED POST and postid >= ID OF FIRST AFFECTED POST

Having said that, hope this helps someone!

Edit: You can check the times of the timestamps in the database by using this convertor; http://www.onlineconversion.com/unix_time.htm
 
Last edited:

K-G

Member
Feb 16, 2005
12
0
151
or waiting 12 hours will correct the thread marking system? i dont care about the wrong dates on posts/threads rightnow but what i do care is threda marking system on my vbulletin forums.
 

Pyrix

Member
Dec 21, 2003
6
0
151
It should do, yes - i'm assuming you're using cookie based marking rather than database-based?

Best place to ask would be vbulletin.com me thinks!
 

eagle

Well-Known Member
Jan 17, 2003
139
0
166
Strange, two servers today, one on CPanel Stable and one on Release ....

Any idea what causes this?
 

simonpearce

Well-Known Member
Jun 20, 2003
90
0
156
Ditto - we've found this problem on three of nine servers so far . . .

Fixed with server time update in WHM but a very bizarre error from cPanel!
 

mrcbrown

Well-Known Member
Jun 5, 2003
99
1
168
When I sync with the WHM update, it stays wrong, I had to sync to an time server elsewhere other than the cpanel one it sync's to by default.

Is there a way to take the cPanel one out of the equation that anyone knows of?
 

rpmws

Well-Known Member
Aug 14, 2001
1,787
10
318
back woods of NC, USA
When I sync with the WHM update, it stays wrong, I had to sync to an time server elsewhere other than the cpanel one it sync's to by default.

Is there a way to take the cPanel one out of the equation that anyone knows of?
cpanel's time server is now correct. I just tested it. use teh time update in WHM again see what you get.