I got this error "Provisioning did not succeed. Details: Failed to initialize some site properties for Web at Url: OriginalException: Object
reference not set to an instance of an object." when trying to create a new site collection or subsite in SharePoint 2019.
PS C:\Users\dev-spfarm> New-SPWeb -Url https:///test1 -Template "CMSPUBLISHING#0"
New-SPWeb : Provisioning did not succeed. Details: Failed to initialize some site properties for Web at Url: 'https:///test1' OriginalException: Object
reference not set to an instance of an object.
At line:1 char:1
+ New-SPWeb -Url https://test1 -Temp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share....SPCmdletNewWeb:SPCmdletNewWeb) [New-SPWeb], SPException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewWeb
PS C:\Users\dev-spfarm>
How can I Create a new Site collection without getting this error "object reference not set instance of object" in SharePoint 2019?