1234

How to Turn on Custom Error Messages in SharePoint 2007

TechTips
When you are dealing with SharePoint 2007 you will more likely than not run into an error sometime while using the software - If not call me you have a job waiting! Well the default setup of SharePoint 2007 displays nearly all errors as the basic error message:

"An unexpected error has occurred"

This message doesn't tell you the least bit about the error and it's pretty hard to troubleshoot the issue based solely on this error message. So what you need to do is edit the web.config to allow the actual error message to be displayed. In this article I will tell you what you need to do to turn on Custom Error Messages in SharePoint 2007. I will also try to explain (defend) why Microsoft's default configuration is to display the generic error message.

In order to turn on Custom Error Messages in SharePoint 2007 you will need to follow these steps:

Logon to the SharePoint server hosting the site giving the error
Navigate to the root folder of the SharePoint site (Typically C:\Inetpub\wwwroot\wss\VirtualDirectories\sitename)
Find the web.config file and make a copy to a remote location (just in case you break it, you can fix it by simply pasting the file back to this location)
Open the file web.config (I opened mine in notepad but if you have another program you prefer use it)
Search for CallStack
Change CallStack to "true"
Search for AllowPageLevelTrace
Change AllowPageLevelTrace to "true"
Search for Errors
Change Mode to "On"
Save web.config
Close the file
Restart IIS

Now you should be able to go back to the SharePoint site that was giving you the generic error and now you should see a much more in-depth error message that you can actually use for troubleshooting the problem. Now you can start using the information from this new error message to track down what the real problem is with the page. This is much easier than trying to do a Google search for "An unexpected error has occurred".

It seems very strange for Microsoft to force the error page to display a generic error as the default method, but they did it for security purposes. If your SharePoint site is public and the error message is very specific about your server or domain and gives information that a possible hacker could use, it wouldn't be very secure. This is why it's not a good idea to leave the custom error messages on, once you get what you need, you should turn the custom error messages off. Only turn them on when you need to get more information.

Well I hope this guide helps you with your SharePoint 2007 site errors and you are able to turn the custom errors on!

Published by TechTips

I am a senior systems engineer and enjoy writing articles about computers, technology and other electronics.  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.