Decyphering SharePoint Runtime Errors
-----------------------------------------------------------------------------------------------------
I've just spent more time than I care to admit trying to kick a SharePoint server to life. The installation completed without a problem. Same too for the configuration wizard. But when it came to actually running SharePoint, the following error message appeared:
I've never been hit by a runtime error before. At least, not one that couldn't be persuaded to go away with the all the usual tricks ('refresh' 'iisreset' 'reboot'...) This time, the error was persistent, meaning I had to actually find out what was going wrong. A few server configuration issues cropped up (this is a hosted server and the Windows installation was completed by someone else). But 3 SharePoint installations later and I still had a runtime error. Time to find out specifically what the problem was.
Interestingly, a search on the web showed that more than a few people get stuck on the first hurdle - decyphering the initial message. If you look at the image above, you'll notice it doesn't actually tell you anything about the error. It just tells you to amend your web.config file so that the error message can be displayed.
To do that, you need to locate the correct web.config file. SharePoint is installed within web applications. Each web application is identified by a port number. The default is port 80. When you type in http://servername you are usually accessing the server through port 80. Any other port will be need to be shown as a colon, e.g. http://servername:11111 is accessing the server through port 11111 (ports can also be assigned to names, but this is not a lecture on ports or web apps).
To locate the correct web.config file, navigate to the Inetpub directory on the file system. Go to wwwroot - wss - VirtualDirectories. Beneath VirtualDirectories, there is one folder per port number. And within each of those folders is the web.config file for the corresponding web application. The image below shows the web.config file selected for port 80. The other two ports listed are for the SharePoint Shared Services Provider and Central Administration
Right-click on web.config and select Edit (or choose to Open With: Notepad). You need to locate the system.web section. It's usually located just under half-way down the file. There you will find the customErrors tag. You need to change its mode to either "RemoteOnly" to view on the local server or "Off" to view across the network. In the example below, the web.config has been modified to view error messages on the local server.
Save the web.config. Now try to access SharePoint again. In my case, the following error message appeared.
A bit more delving and it appears the hosting provider (this is a hosted SharePoint server) has configured overrides at a higher level than the web application to prevent changes to security settings. SharePoint needs to amend those security settings in order to work = stalemate. I'm now in discussions with the hosting provider to see if we can get SharePoint running or not...
Technorati tags: SharePoint; MOSS 2007