This past weekend our website running with IIS 6.0 stopped handling calls to web services. The log file was filled with the following error until the server was rebooted approximately 8 hours later:

2011-05-08 01:53:12,109 ERROR - Execution permission cannot be acquired.

2011-05-08 01:53:12,135 ERROR - at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission).

This error above appears another 316,871 times in the web log file.

The timing was interesting in that the first error above occurred immediately after the 29 hour applciation pool recycle was scheduled as I see this entry:

A worker process with process id of '758628' serving application pool 'gpsigolf.com' has requested a recycle because the worker process reached its allowed processing time limit.

in the event log (using the event viewer) just before the problem and associated log file filled with the Execution permission error start. This entry is also exactly 29 hours after the previous such entry in the event log.

The server has been running since without issue through several application pool recycles and had been running for five days prior to this problem happening. It is a new server we had migrated to so it had only been up a total of five days prior to running into this problem.

The question is why/how would an application pool recycle cause this problem? Are there certain settings we should avoid like Overlapped Recycling for instance?

  • Overlapping recycle comes to mind, but that's also something that should show up when you do a right-click recycle, unless there's another set of conditions that cause this to happen. – TristanK May 12 '11 at 5:10
  • Should add - disabling overlapped recycling means you may wait up to 90 seconds for the next request to be processed, depending on the Shutdown time limit for the app pool. – TristanK May 12 '11 at 5:11

I would turn off the recycle after 29 hours (1740 minutes). It's just the default but not useful in production. If you must automatically recycle, do it at a set time off-hours.

The overlapping app pools is perfectly healthy. Check out this recent video in my Web Pro series that covers it.

My guess on what happened is that something had a handle on one of the key files in your site and IIS couldn't get execute permissions on it. It probably didn't turn up until IIS released the file during the recycle and something else took over.

When it happens again (which it will likely do so since nothing has changed), I recommend using Process Monitor and/or Process Explorer to find out which file is locked. It should turn up by searching for 'denied' in a Process Monitor capture. Here's another quick video on how to use Process Monitor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.