joelortizsosa / slimtune

Automatically exported from code.google.com/p/slimtune
MIT License
1 stars 1 forks source link

TEMP variable settings on WIN2k3 cause invalid directory error when profiling ASP.Net application. #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using Win2K3 R2 Web Edition SP2

After attaching the profiler multiple issues were observed:

1. Site failed pre-compile stage with "Invalid Path" errors for pages that
had not already been pre-compilied. "Invalid Path" error points to ASP.Net
Temporary Files directory, but this is not the actual reason for the error.
(See below)

2. Lucene Search Index could not obtain/create lock file in the %TEMP%
directory. 

Further analysis showed that the %TEMP% variable was pointing to the
current logged on user's TEMP folder (under documents and settings). The
Network Service account didn't have rights to write into this area, even
after granting "Everyone" full access to that folder. This is similar to an
issue reported on stack overflow:

http://stackoverflow.com/questions/794323/iis-6-0-and-asp-net-could-not-write-to
-output-file-the-directory-name-is-in

===========

Workaround: 

Go to My Computer->Properties->Advanced->Environment Variables

Change %TEMP% and %TMP% to point to %SYSTEMROOT%\TEMP for the User that
will run the profiler. 

Restart IIS, and log out. Relog in as the same user. 

Reset permissions on %SYSTEMROOT%\TEMP to allow "BUILTIN\NETWORK SERVICE"
full access to the directory.

*** IMPORTANT: Be sure to remove full control for this account after you
are done profiling, especially if you are profiling in your production
environment, as this can cause a security vulnerability. ***

Thanks for a great tool, I hope this info helps you out!

Nick P.
nick@chi-town.com

Original issue reported on code.google.com by wln...@gmail.com on 13 May 2010 at 3:54

GoogleCodeExporter commented 9 years ago
I appreciate all the work you've done, but I don't really understand exactly 
how I'm supposed to fix it on the profiler end. It sounds like ANTS is affected 
to some degree as well, and I guess it's a result of modifying the ASP.NET 
environment.

Original comment by promit....@gmail.com on 17 Jul 2010 at 5:44

GoogleCodeExporter commented 9 years ago
Closing for now, still don't entirely understand the nature of the bug. Is IIS 
being launched as the current user? Need more info.

Original comment by promit....@gmail.com on 8 Mar 2011 at 5:40