AutoSPInstaller
AutoSPInstaller copied to clipboard
Create Site Collection faling
Hi all!
When running the script it halts at creating the sitecollection for the Portal Site. If I do it trough Central Admin it works as it should. (Same account) Just cant figure out why I get this exception below.
- Done applying object cache accounts to "http://portal.contoso.com:80"
- Checking for Site Collection "http://portal.contoso.com"...
- Creating Site Collection "http://portal.contoso.com"...
- Script halted!
Exception : System.UnauthorizedAccessException:
Similar issue is happening with latest commit. On first run, it will report error. Close the windows and re-run and the second run will pass without issue.
- Checking for Site Collection "http://dummyteamsite.dummysite.com"...
- Creating Site Collection "http://dummyteamsite.dummysite.com"... PS>TerminatingError(New-SPSite): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Invalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e} http://dummyteamsite.dummysite.com "
TerminatingError(New-SPSite): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Invalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e} http://dummyteamsite.dummysite.com " TerminatingError(New-SPSite): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Invalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e} http://dummyteamsite.dummysite.com " TerminatingError(New-SPSite): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Invalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e} http://dummyteamsite.dummysite.com "
- Script halted!
Exception : Microsoft.SharePoint.SPException: Invalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e}
http://dummyteamsite.dummysite.com ---> System.Runtime.InteropServices.COMException:
1& featureDependencyErrors) at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection1& featureDependencyErrors)
at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(String strWebTemplate)
at Microsoft.SharePoint.Administration.SPSiteCollection.AddInternal(SPSiteCollectionAddParameters param)
at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPSiteCollectionAddParameters param)
at Microsoft.SharePoint.PowerShell.SPCmdletNewSite.CreateDataObject()
at Microsoft.SharePoint.PowerShell.SPNewCmdletBase`1.InternalProcessRecord()
at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()
TargetObject : Microsoft.SharePoint.PowerShell.SPCmdletNewSite
CategoryInfo : InvalidData: (Microsoft.Share...SPCmdletNewSite:SPCmdletNewSite) [New-SPSite], SPException
FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at CreateWebApp, C:\Users\administrator.dummysite\Desktop\SP\Automation\AutoSPInstallerModule.psm1:
line 2933
at CreateWebApplications,
C:\Users\administrator.dummysite\Desktop\SP\Automation\AutoSPInstallerModule.psm1: line 2712
at Set-FarmConfig, C:\Users\administrator.dummysite\Desktop\SP\Automation\AutoSPInstallerMain.ps1:
line 230
at <ScriptBlock>, C:\Users\administrator.dummysite\Desktop\SP\Automation\AutoSPInstallerMain.ps1: line
429
at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
PSMessageDetails :
| Automated SP2019 install script | | Started on: 8/1/2019 10:00:56 PM | | Aborted: 8/1/2019 10:21:11 PM |
I get this error too occasionally. Haven't dug in to see if it's really an issue with the script, with SharePoint, or with overall timing.
Just to confirm, I get error as well and it seemed random. However, I think I may be narrowing in on the issue. When I create site using PowerShell command the site creation fails. However, if I run SharePoint Configuration Wizard and then run the exact PowerShell command it works. My hunch is the SharePoint Wizard is updating or repairing something.
Similar issue is happening with latest commit. On first run, it will report error. Close the windows and re-run and the second run will pass without issue.
Same issue and same fix. As a workaround I first run AutoSPInstaller with no site collections defined in the config, then run it again with the site collections defined.
same here with SP2K19 - will try the workaround
Make sure that the IIS site SharePoint Web Services is running.
I got the same UnauthorizedAccessException when installing SharePoint 2016. After a few script rounds and restarts of the machine I tried to create the site manually using New-SPSite. But I got the same problem with the Admin/Setup account as well as other admin accounts as well.
I checked the accounts for permissions, but they had more than should be needed. Eventually I started comparing with a SP2019 server that installed successfully using a very similar config XML file and noticed that the IIS Site wasn't running (and apparently hadn't started even after a reboot), so after starting that I could create the site. I removed it and ran AutoSPInstaller again and this time it finally completed.
Maybe there could be a check before creating the site collection, so that all IIS sites and app pools are running correctly, at least the SharePoint Web Services site.
same problem with SharePoint Server 2019
Second run working... That is no timing --> I added a 120 second sleep before New-SPSite, same failure with ...Invalid field name...
Here is a Workaround: https://github.com/dsccommunity/SharePointDsc/pull/1342