If any of you have children, you're probably well aware of their awesome ability to spread around every new variation of the common cold that appears. This week I've been mostly suffering under the latest of these "presents" from my son, and to be honest may not be doing my sharpest ever thinking...
Coincidentally it took me a bit of head-scratching to resolve a problem with an experimental instance of Sitecore 6.6 that I wanted to make use of the other day. Browsing to the public site appeared fine, but when I tried to load Content Editor I was greeted with an exception saying
Access to the path 'C:\inetpub\wwwroot\TEST\Data\viewstate\1\7\E' is denied.:
I Googled this, and got a collection of things relating to "incorrect file system permissions" but nothing specific to the particular error I was seeing. Oddly a separate instance that had been set up using the same process and files appeared to be working fine.
Having compared file permissions and folder structures with the Google results I had, the answer turned out to be related to the fact that your IIS Application Pool process account needs to have write access to the instance's "Data" folder. (This is described in the manual install instructions on SDN) But the error above only appeared at the point that Sitecore needed to write data. The only difference I spotted between the working and broken instance was that the broken one's Viewstate folder had been cleaned out:
The instance of Sitecore that had a "viewstate" folder full of files didn't give the error despite the missing permission. But when I removed those files, the error appeared when Sitecore tried to re-create this data.
So should you ever find yourself with a similar error message, here's what to try:
Check what process account your instance of Sitecore's App Pool is running under. Find the App Pool in IIS Manager and look at the Advanced Settings:
Then check whether this account has "Modify" permissions to the Sitecore instance's "Data" folder:
If this permission is missing, add it back in:
You should now find that your site works again...