Wednesday, May 8, 2013

Project Server 2010 : Failed to provision site PWA with error: System.NullReferenceException: Object reference not set to an instance of an object.

Problem:


I was trying to take project server 2010 databases from PROD and refresh them in the DEV environment by using 5 database restore process (Reference: Project Server 2010 : Migration or Restore in New Farm.
When I tried initially, the PWA site was missing the Project Site urls under Server Settings -> Project Sites page. Then, I deleted the SharePoint web application and also deleted the Project Server related 5 DBs manually. I restored the 5 DBs and added the project server content db to the newly created web application. When I tried to Provision the Project Web Application (PWA), it failed and I observed the following 3 error messages in Event Log:
Event Log: Error Log Entry 1
Failed to provision site PWA with error: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.SPSite..ctor(Guid id, SPFarm farm, SPUrlZone zone, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(Guid id)
at Microsoft.Office.Project.Server.Administration.ProjectSite..ctor(Guid webAppId, Guid siteId, String adminName, Int32 lcid, Boolean needsUpgrade, PsiServiceApplication parent)
at Microsoft.Office.Project.Server.Administration.ProjectSiteCollection.Add(Guid webAppId, Guid siteId, String adminName, Int32 lcid, String PubDBConnString, String VerDBConnString, String WorkDBConnString, String RepDBConnString, Boolean needsUpgrade)
at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)
Event Log Error Entry 2: Provisioning ‘PWA’: Project site object creation failed. Exception ‘System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SharePoint.SPSite..ctor(Guid id, SPFarm farm, SPUrlZone zone, SPUserToken userToken)
at Microsoft.SharePoint.SPSite..ctor(Guid id)
at Microsoft.Office.Project.Server.Administration.ProjectSite..ctor(Guid webAppId, Guid siteId, String adminName, Int32 lcid, Boolean needsUpgrade, PsiServiceApplication parent)
at Microsoft.Office.Project.Server.Administration.ProjectSiteCollection.Add(Guid webAppId, Guid siteId, String adminName, Int32 lcid, String PubDBConnString, String VerDBConnString, String WorkDBConnString, String RepDBConnString, Boolean needsUpgrade)
at Microsoft.Office.Project.Server.Administration.PsiServiceApplication.CreateSite(ProjectProvisionSettings provset)’.
Event Log Error Entry 3: ProjectSite not created.
SOLUTION:
Something in the SharePoint config or Project Server Config was corrupted.
After hours of trial, I ran the Project Server Installation wizard and did Repair of the installation. The repair process went successfully. 
After that, I did following:
a. Created Web Application with default root site collection.
b. Ensure that site is up and working fine.
c. Go to manage content databases, remove the content database for the above created web application.
d. Restored all the 5 databases in the database server.
e. Attached the project server content database(s) to the web application using the STSADM command (not thru UI). After attaching, if we go to View Site Collections option from Central Admin, we should be able to see PWA site collection for the above created web application.
f. Navigated to Project Server Service Application and created a new Project Web Application by pointing to restored Archive, Published, Reporting, Draft databases.
g. Project Web Application provisioning took sometime and provisioned successfully.
h. When I opened the PWA site, the site came up fine but faced few minor issues which I resolved with the help of following posts:

Finally happy with the output :)

Note: The above is just my experience. Please ensure you fully understand and leverage from my experience for your needs to avoid any further issues.

No comments: