Forum Discussion

David-Haver's avatar
David-Haver
Copper Contributor
Aug 24, 2021
Solved

SharePoint 2019 Unable to create site collections after installing Aug 2021 CU

I installed the Aug 2021 CU to both my Dev and PreProd environments.  In my PreProd environment I can no longer create a site collection.  It works fine in Dev.  The ULS log is showing these errors. ...
  • ccotegu's avatar
    ccotegu
    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 Support

    1) 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"} | fl

     

    You 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'
    go

     

    Locate 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

Resources