WinBlogs

Some techy stuff and occasional verbose ramblings :D

IIS server, Servers, WebSitePanel Fixes, Windows and Powershell

Automatic time update in Windows (sync with internet time a.k.a NTP server )

Few days ago, I had a strange issue where all of a sudden, the statistics on some of my web servers stopped working.

First thought was, nah, its some PEBKAC issue. Statistics was working great, and nothing in the configuration wasnt changed for months. The customer must have some outdated link, wrong password or something else.

 

The error my customers were getting is :

 

Microsoft.Web.Services3.ResponseProcessingException: WSE910: An error happened
during the processing of a response message, and you can find the error in the
inner exception. You can also find the response message in the Response
property. ---> Microsoft.Web.Services3.Security.SecurityFault: An error was
discovered processing the header ---> System.Exception: WSE065: Creation time of
the timestamp is in the future. This typically indicates lack of synchronization
between sender and receiver clocks. Make sure the clocks are synchronized or use
the timeToleranceInSeconds element in the microsoft.web.services3 configuration
section to adjust tolerance for lack of clock synchronization. --- End of inner

 

The part of the error that gave me a hint is:
Creation time of the timestamp is in the future. This typically indicates lack of synchronization between sender and receiver clocks.

 

Soooo…I login to my WebSitePanel server and check the time…it was 9:24 AM. I login to the web server that is giving the above mentioned error , also 9.24 AM.

First reaction…WTH!!?!?!?!?

I thought to myself: “Nah..I’ll try it anyway. Left click on the Clock, change time and date settings, Internet time, Change settings, and then click the “Update now”. All of a sudden, my statistics started to work. GREAT, that part is solved.

Now, lets try to find the reason for this behaviour, ofcourse, there are hundreds of articles on the web, and every single one of them is pretty much useless in my case :).

My search was pointless, and quoting James May from Top Gear, I thought to myself:

“Oh cock!” 🙂

Well, atleast let me try to patch the thing up. My idea was to use our own ntp servers on all our windows machines ( instead of time.windows.com, or some other ntp server listed ). In order to achieve this, you must replicate these steps:

  1. Stop the W32Time service with : C:\>net stop w32time
  2. Configure the external NTP server by  typing : C:\> w32tm /config /syncfromflags:manual /manualpeerlist:”1stNTP.domain.com, 2ndNTPserver.domain.com”
  3. Then make your  PDC a reliable NTP server with  C:\>w32tm /config /reliable:yes
  4. Start the w32time service with : C:\>net start w32time
  5. You can check the NTP servers configuration by typing: C:\>w32tm /query /configuration

Next thing I decided to do was to autmate the time sync, since I didnt want to rely on Windows to do it.

Command for that is pretty simple : c:\w32tm /resync

In order to achieve that, I created a batch file with the above mentioned command, set it to run every day at 12:00 AM, and thats it. Never heard of time sync issues EVER again!

Bye, Alesandro

3 Comments

  1. Richard

    Hey,

    Have you experienced this issue with AWStats on WebsitePanel? Did you manage to work around it?

    http://websitepanel.codeplex.com/workitem/22

  2. Alesandro Slepčević

    Hi, no, I haven’t encountered this issue yet.
    Do you have web.deploy installed on the machine? – http://www.iis.net/download/WebDeploy
    What permissons does the Awstats folder have, and what log format did you choose in IIS for your websites? Choose w3c format, and select all avaiable fields.

    How does your awstats.model.conf look like? Can you upload it somewhere so I can take a look?
    Is there some other messages in the event log?

  3. brielhans

    Alesandro, oh how I understand you, we (~400 machines with w23tm) fought the same issue for a half of year (our company policy i.e. firewall disallows us to set each workstation to sync with pool.ntp.org for expamle)
    In the end we move to NTS time server http://nts.softros.com ow it was just like a heaven after hell – closed time infrastructure with almost zero-configuration and maintain , so I would recommend it if company budget is Ok for that

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Theme by Anders Norén