January 7, 2008

MOSS: Deleting site gives error message

Problem:
When deleting a site, you get error: 500 INTERNAL SERVER ERROR. Error is just black text on white background, nothing else.

Some errors are logged into MOSS log:

There is no Web named "/SiteA/testi/_layouts/webdeleted.aspx".

Possible mismatch between the reported error with code = 0x81070504 and message: "There is no Web named "/SiteA/testi/_layouts/webdeleted.aspx"." and the returned error with code 0x80070002.

Thoughts:
Simple.master page has been altered to brand the layout of different pages, which is causing the problem.

Workaround:
Revert Simple.master to original version that came with MOSS.

Solution:
You cannot have

<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false"></wssuc:Welcome>

on the simple.master page. Remove it and it works, if not, remove controls from the page one by one until you find out the one causing the error.

1 comment:

  1. When receiving the File not found error, it is important to look at the stack trace carefully. It gives clues as to what the problem is. It would be nice if it indicated what the actual problem was, but this is SharePoint. If the stack trace indicates that it's failing when trying to open a SPSite/SPWeb then there might be controls on your custom simple.master page that can't render. They can't render because they assume that the site/web still exist, and then try to get a reference to it. Take a look at how the url is structured, http://mydomain/sitename/_layouts/webdeleted.aspx. The virtual directory, _layouts, is getting accessed by a site that doesn't exist anymore. This is why the out of the box webdeleted page doesn't have controls on it that reference the current site. Take a look at the code for the simple.master and the webdeleted.aspx file. Everything in them is either static or non-site specific. You can test this very easy to see if this is your problem. Create a new site, then in the browser type http://mydomain/newsite/_layouts/webdeleted.aspx. This will not delete the site, but it will display a deleted confirmation page. If the confirmation page renders without the file not found error, then this is most likely the issue. To fix this, go into the custom simple.master and remove anything that is site specific. For example site actions buttons or access to lists in the current context. Happy coding!
    Feel free to email me if you have questions.

    ReplyDelete