I am creating PWA sites programmatically ( have used same code as mentioned on one of the MSDN forum "Getting started with the Project Server CSOM and .NET" )
It works properly most of the times but some times it fails. Only the "Enterprise Project" get created and its related PWA site doesn't. When I go to "Manage Queue Jobs" I can see that "Project Site Update" Job is failed.This is really weird, at my Customer side it doesn't work many times and works rarely. As it works properly that means there is no problem with code nor with the environment configurations.Below are the details of the Error
CreateWssSiteContent: Creating project site failed! Project Uid=9ae86424-62b0-4159-8e9e-b1e47bb45290, site URL=*****:19002/PWA/TestSarvesh4, site name=TestSarvesh4. System.Runtime.InteropServices.COMException (0x8107058A): <nativehr>0x8107058a</nativehr><nativestack></nativestack>Microsoft.SharePoint.SPException
at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32& plWebTemplateId)
at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32& plWebTemplateId)Microsoft.SharePoint.SPException:
Microsoft.SharePoint.SPException ---> System.Runtime.InteropServices.COMException: <nativehr>0x8107058a</nativehr><nativestack></nativestack>Microsoft.SharePoint.SPException at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String
bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32& plWebTemplateId) at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl,
String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32& plWebTemplateId) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException
comEx) at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, String& bstrWebTemplate, Int32& plWebTemplateId) at
Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate) at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate) at Microsoft.SharePoint.SPSite.CreateWeb(String
strUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean bCreateUniqueSubweb, Boolean bConvertIfThere, Guid webId, Guid rootFolderId, Boolean createSystemCatalogs, Guid appInstanceId, String appWebDomainId) at Microsoft.SharePoint.SPSite.SPWebCollectionProvider.CreateWeb(String
strWebUrl, String strTitle, String strDescription, UInt32 nLCID, String strWebTemplate, Boolean bCreateUniqueSubweb, Boolean bConvertIfThere, Guid appInstanceId) at Microsoft.SharePoint.SPWebCollection.Add(String strWebUrl, String strTitle, String strDescription,
UInt32 nLCID, String strWebTemplate, Boolean useUniquePermissions, Boolean bConvertIfThere, Guid appInstanceId) at Microsoft.Office.Project.Server.BusinessLayer.AdminProjectSiteAllocator.CreateSPWeb(ProjectSiteConfigurationInfo configInfo, SPSite topSite):
WSSCreateSiteFailure
(16400). Details: id='16400' name='WSSCreateSiteFailure' uid='7e1c57d3-4084-e411-944d-14dae9040812' projectUID='9ae86424-62b0-4159-8e9e-b1e47bb45290' workspaceUrl='*****:19002/PWA/TestSarvesh4/TestSarvesh4' projectWorkspaceName='TestSarvesh4'.
Queue:
GeneralQueueJobFailed
(26000) - CreateWssSite.CreateWssSiteMessage. Details: id='26000' name='GeneralQueueJobFailed' uid='7f1c57d3-4084-e411-944d-14dae9040812' JobUID='01e5f7d2-4084-e411-944d-14dae9040812' ComputerName='a1ad1519-f04b-40c0-877c-cd7059250ba9' GroupType='CreateWssSite'
MessageType='CreateWssSiteMessage' MessageId='1' Stage='' CorrelationUID='ebf8d59c-a4d7-30e6-50ba-937d5ec96b26'. For more details, check the ULS logs on machine a1ad1519-f04b-40c0-877c-cd7059250ba9 for entries with JobUID 01e5f7d2-4084-e411-944d-14dae9040812.
Can some please give some pointers? I am struggling to get this fixed and it is hard to reproduce as well because out of 50 this occurs only once on development environment but on production it is failing quite often.
Thanks in advance.
Regards Sarvesh Shinde SharePoint Developer, India