Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > WebAnalytics Processing throws error constantly View modes: 
User avatar
Member
Member
josh.heaton-gmail - 12/3/2012 12:17:07 PM
   
WebAnalytics Processing throws error constantly
Hello,

I am doing work on a Kentico 6.0 system that runs 3 sites that are setup in the same Kentico instance, each with a separate AppPool, and IIS entry. The issue I am having is when the Scheduled Task process analytics logs runs it throws this error, it almost seems like a race condition between the site writing out to these files and the task processing and deleting these files. I've changed the time on the schedule tasks numerous times to 2, 5, 10, 15 minutes but this seems to not stop the error from showing up. I've also changed the start time seconds from 0 to 10, 15, 35 and still nothing. I've also applied the latest hotfix.

Has anyone ever had this happen before, if so what was your solution? Does anyone else maybe have a potential solution?


EventID: 362494

EventType: E

EventTime: 12/3/2012 11:21:57 AM

Source: WebAnalytics

EventCode: LOGHIT

IPAddress: <an IP>

EventDescription: Message: The process cannot access the file 'P:\OurSite\App_Data\CMSModules\WebAnalytics\exitpagecandidate_121203_1121.log' because it is being used by another process.
Stack Trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
at System.IO.File.InternalAppendAllText(String path, String contents, Encoding encoding)
at CMS.CMSStorage.File.AppendAllText(String path, String contents, Encoding encoding)
at CMS.IO.File.AppendAllText(String path, String contents, Encoding encoding, Boolean logOperation)
at CMS.WebAnalytics.HitLogProvider.LogHit(String codeName, String siteName, String culture, String objectName, Int32 objectId, Int32 count, Double value)


EventUrl: /Page.aspx

EventMachineName: PRODUCTION

EventUserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)

EventUrlReferrer: a page url


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/3/2012 2:52:21 PM
   
RE:WebAnalytics Processing throws error constantly
Hi,

What is the traffic on the site and how many files are in that location to be processed? This issue is usually caused by the fact that the previous run of the scheduled task is still being executed - so the file is locked, but the another scheduler execution is fired. You have already tried to increase the execution time out, could you please give it a try and set it e.g. to one hour for a short period of time, so all the files are processed correctly and then decrease the time period to some lower limit?

Best regards,
Juraj Ondrus

User avatar
Member
Member
josh.heaton-gmail - 12/3/2012 4:22:50 PM
   
RE:WebAnalytics Processing throws error constantly
We have anywhere from 5,000 to 10,000 hits per day on the main site. The other 2 sites, slightly less than that. I've bumped up the execution time to an hour, I'll report back if there are any issues.

User avatar
Member
Member
josh.heaton-gmail - 12/4/2012 11:39:55 AM
   
RE:WebAnalytics Processing throws error constantly
I've bumped up the execution of the scheduled tasks to an hour, but as of right now the scheduled tasks don't seem to be the issue, these errors are still popping up every few minutes. There are close to 1000 of these errors logged within the past 4 hours.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/5/2012 12:45:51 AM
   
RE:WebAnalytics Processing throws error constantly
Hi,

Have you tried using the Process explorer tool to see which process is locking the files?

Also, you can try to move the files to some temp location, restart the application pool or application, then copy just a few files back and run the scheduled task to see what happens.

Best regards,
Juraj Ondrus