How to upload a default.master when the current one is corrupted

Author: NetworkAdminKB.com
Created: 2008-12-13
Modified: 2011-12-12

 

Issue:

You receive the following (or similar) error after uploading a new default.master page.

 

An error occurred during the processing of /_catalogs/masterpage/default.master. Code blocks are not allowed in this file.

Troubleshoot issues with Windows SharePoint Services.

 

Cause:

A misconfigured version of the default.master page has been uploaded to the web site, or the file has become corrupted.

 

Solution:

Normally you can just use the web browser back button or Web History to go back to the Upload page.  However, if you have closed your web browser or discovered the issue caused by another user you will not have this information stored in your web browsers history.  Using the steps below you can successfully fix the issue.

 

1)  Use the following SQL query to determine the proper ListID

a.  Change '_catalogs/masterpage' in the SQL query to be the same as the path listed in your error message.  No leading or ending “/” should be specified.

b.  Change WSS_Content to the name of your WSS Content database.

 

Use WSS_Content

Select Leafname, DirName, ListID from AllDocs

 where leafname = 'default.master' and

 dirname = '_catalogs/masterpage'

 

c.  Run the SQL Query

2)  Copy the ListID from the results.  The ListID will look similar to the following example:

a.  B1FE76DA-D783-4171-97FF-A8034FE8D537

3)  Modify the following URL with the the proper sitename and ListID for your website.  Also, update /_catalogs/masterpage to be the same on the one listed in your error message.  These items are highlighted in Red.

 

http://sitename/_layouts/Upload.aspx?List={B1FE76DA-D783-4171-97FF-A8034FE8D537}&

RootFolder=/_catalogs/masterpage&Source=http://sitename/_catalogs/masterpage/Forms/AllItems.aspx

 

4)  After creating the URL paste it into a web browser.  This will bring up the Upload Master Page: Master Page Gallery web page.  You can now upload a new default.master page.

a.  You may need to authenticate to the web site before pasting the URL into the web browser.

 

More Information:

You should bookmark all Upload Master Page web pages on your site to simplify recovery from default.master page errors in the future.

 

Article ID: 518, Created On: 12/12/2011, Modified: 12/12/2011