ONET.xml – Provisioning did not succeed. Details: Failed to initialize some site properties for Web

If you use Visual Studio to create new Web Templates you sometimes get this error when testing your work:

Provisioning did not succeed. Details: Failed to initialize some site properties for Web at Url: ‘http://server/sites/test’ OriginalException: <nativehr>0×80070002</nativehr><nativestack></nativestack>

To diagnose this error, go straight to ULS logs that usually sit under C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14LOGS

Look for your site URL at the bottom of the file, if you recently have got that error. Don’t bother looking by correlation guid, notepad search will not find it for some reason.

You should see more details why your site has not been created.

E.g. you will find that provisioning process actually checks some files existance. You will find:

GetFileFromUrl: FileNotFoundException when attempting get file Url http://server/sites/test/_catalogs/masterpage/MyCustomLayout.aspx<nativehr>0×80070002</nativehr><nativestack></nativestack>

You must ensure that this file is in the library when this feature is activated.

This is onet.xml fragment that you should be careful with.

 <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="WelcomePageUrl" 
         Value="$Resources:osrvcore,List_Pages_UrlName;/Home.aspx" />
            <Property Key="SimplePublishing" Value="True" />
            <Property Key="VersioningOnPages" Value="Major" />
            <Property Key="RequireCheckoutOnPages" Value="False" />
            <!--added custom layout -->
            <Property Key="AvailablePageLayouts" 
       Value="~SiteCollection/_catalogs/masterpage/EnterpriseWiki.aspx
 :~SiteCollection/_catalogs/masterpage/RedirectPageLayout.aspx
 :~SiteCollection/_catalogs/masterpage/ProjectPage.aspx"/>
            <!-- custom default layout WikiWelcomePage-->
            <Property Key="DefaultPageLayout" 
Value="~SiteCollection/_catalogs/masterpage/MyCustomLayout.aspx"/>  
            <Property Key="AllowSpacesInNewPageName" Value="true"/>
          </Properties>
        </Feature>

2 Responses to “ONET.xml – Provisioning did not succeed. Details: Failed to initialize some site properties for Web”

  1. Emmanuel

    Beautiful website logo ;)

    Reply
  2. Daniel McNulty

    HUGE help! Been stuck on this for an hour before reading this article, thanks a lot.

    Reply

Leave a Reply