Forum Discussion
SharePoint 2019 Unable to create site collections after installing Aug 2021 CU
- Sep 03, 2021
Hi David-Haver
With the help of Microsoft Support, we resolved the issue in our environment. I'm not sure if the same root cause will apply to yours, but what we found is the SharePoint_Config database had a reference to a missing Content Database. This caused process to create the site collection to fail using both the Central Admin UI and PowerShell. I did notice however that explicitly setting the target content databases for the site collection did work.
## Succeeded
New-SPSite -Url https://portal.domain.com/sites/ccotetest -Template "STS#3" -Name "ccotetest" -OwnerAlias "domain\ccote" -ContentDatabase "Portal_Content_01"## Failed - New-SPSite : Object reference not set to an instance of an object.
New-SPSite -Url https://portal.domain.com/sites/ccotetest1 -Template "STS#3" -Name "ccotetest1" -OwnerAlias "domain\ccote"
Resolution: With the help of Microsoft Support1) Get the SharePoint Web Application ID for the web application where you can create new site collections:
Add-PSSnapin Microsoft.SharePoint.PowerShell
get-spwebapplication | ? {$_.displayname -eq "NameOfYourWebApplication"} | flYou retrieve the Application ID - example: 4a23e792-6701-41e8-89f7-00c4eaefddce
2) Run the following Query on the SQL Server - where the ID is of the Web Application:
*** Important: You do require a Microsoft Support Case to run any SQL queries to be supported under the service agreement. Running queries on SQL SharePoint databases voids your support otherwise. Always have Microsoft Support approve running SQL queries against your environment. ***
use [SharePoint_Config]
select ID, Name, CAST (properties as xml) from Objects where ID = '4a23e792-6701-41e8-89f7-00c4eaefddce'
goLocate the orphaned Content Database record from the XML output - Microsoft Support can help you to locate the orphaned database with the output file.
3) Using PowerShell, remove the orphan entry from the configuration:
$wa = get-spwebapplication | ? {$_.displayname -eq "NameOfYourWebApplication"}
$wa.contentdatabases.delete('guid-of-the-orphan-content-database')
I hope this helps!Regards,
Charles
- ccoteguSep 02, 2021Copper ContributorThanks David for the quick reply. I'm about to do the same and open an MS Support case. Please keep us posted if you find a resolution!
- David-HaverSep 02, 2021Copper ContributorWill do 🙂
- ccoteguSep 03, 2021Copper Contributor
Hi David-Haver
With the help of Microsoft Support, we resolved the issue in our environment. I'm not sure if the same root cause will apply to yours, but what we found is the SharePoint_Config database had a reference to a missing Content Database. This caused process to create the site collection to fail using both the Central Admin UI and PowerShell. I did notice however that explicitly setting the target content databases for the site collection did work.
## Succeeded
New-SPSite -Url https://portal.domain.com/sites/ccotetest -Template "STS#3" -Name "ccotetest" -OwnerAlias "domain\ccote" -ContentDatabase "Portal_Content_01"## Failed - New-SPSite : Object reference not set to an instance of an object.
New-SPSite -Url https://portal.domain.com/sites/ccotetest1 -Template "STS#3" -Name "ccotetest1" -OwnerAlias "domain\ccote"
Resolution: With the help of Microsoft Support1) Get the SharePoint Web Application ID for the web application where you can create new site collections:
Add-PSSnapin Microsoft.SharePoint.PowerShell
get-spwebapplication | ? {$_.displayname -eq "NameOfYourWebApplication"} | flYou retrieve the Application ID - example: 4a23e792-6701-41e8-89f7-00c4eaefddce
2) Run the following Query on the SQL Server - where the ID is of the Web Application:
*** Important: You do require a Microsoft Support Case to run any SQL queries to be supported under the service agreement. Running queries on SQL SharePoint databases voids your support otherwise. Always have Microsoft Support approve running SQL queries against your environment. ***
use [SharePoint_Config]
select ID, Name, CAST (properties as xml) from Objects where ID = '4a23e792-6701-41e8-89f7-00c4eaefddce'
goLocate the orphaned Content Database record from the XML output - Microsoft Support can help you to locate the orphaned database with the output file.
3) Using PowerShell, remove the orphan entry from the configuration:
$wa = get-spwebapplication | ? {$_.displayname -eq "NameOfYourWebApplication"}
$wa.contentdatabases.delete('guid-of-the-orphan-content-database')
I hope this helps!Regards,
Charles