brianlala / AutoSPInstaller

Automated SharePoint 2010/2013/2016/2019/SE PowerShell-based installation script.
https://autospinstaller.com
MIT License
171 stars 81 forks source link

Create Site Collection faling #17

Open DJTaz1975 opened 6 years ago

DJTaz1975 commented 6 years ago

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.

Exception : System.UnauthorizedAccessException: 0x80070005A ccess denied. at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessExcepti on ex) at Microsoft.SharePoint.Library.SPRequest.CreateSite(Guid gApplicationId, String bstrUrl, In t32 lZone, Guid gSiteId, Guid gDatabaseId, Guid gSiteSubscriptionId, String bstrDatabaseServer, String bstrDatabaseName, String bstrDatabaseUsername, String bstrDatabasePassword, String bstr Title, String bstrDescription, UInt32 nLCID, String bstrOwnerLogin, String bstrOwnerUserKey, St ring bstrOwnerName, String bstrOwnerEmail, String bstrSecondaryContactLogin, String bstrSeconda ryContactUserKey, String bstrSecondaryContactName, String bstrSecondaryContactEmail, Boolean bA DAccountMode, Boolean bHostHeaderIsSiteName, Int32 iDatabaseVersionMajor, Int32 iDatabaseVersio nMinor, Int32 iDatabaseVersionBuild, Int32 iDatabaseVersionRevision, Int32 iSprocsVersionMajor, Int32 iSprocsVersionMinor, Int32 iSprocsVersionBuild, Int32 iSprocsVersionRevision, String bst rSiteSchemaVersion, Boolean bCreateFromMaster, String bstrDenyPermMaskGroupId) at Microsoft.SharePoint.Administration.SPSiteCollection.AddInternal(SPSiteCollectionAddParam eters param) at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPSiteCollectionAddParameters pa ram) 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], UnauthorizedAcce ssException FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite ErrorDetails : InvocationInfo : System.Management.Automation.InvocationInfo ScriptStackTrace : at CreateWebApp, D:\Setup\AutoSPInstaller\SP\AutoSPInstaller\AutoSPInstallerFunctions.ps1: line 2909 at CreateWebApplications, D:\Setup\AutoSPInstaller\SP\AutoSPInstaller\AutoSPInstallerFunctions. ps1: line 2690 at Setup-Farm, D:\Setup\AutoSPInstaller\SP\AutoSPInstaller\AutoSPInstallerMain.ps1: line 228 at , D:\Setup\AutoSPInstaller\SP\AutoSPInstaller\AutoSPInstallerMain.ps1: line 427 at , : line 1 PipelineIterationInfo : {} PSMessageDetails :

desmondkung commented 5 years ago

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.

Exception : Microsoft.SharePoint.SPException: Invalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e} http://dummyteamsite.dummysite.com ---> System.Runtime.InteropServices.COMException:

0x8107058aInvalid field name. {cbb92da4-fd46-4c7d-af6c-3128c2a5576e} http://dummyteamsite.dummysite.com at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) at Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyErrors) at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& 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 , C:\Users\administrator.dummysite\Desktop\SP\Automation\AutoSPInstallerMain.ps1: line 429 at , : 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 | -----------------------------------
brianlala commented 5 years ago

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.

MyProjectExpert commented 5 years ago

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.

jackpoz commented 5 years ago

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.

flotpg commented 4 years ago

same here with SP2K19 - will try the workaround

kenneth-larsson commented 4 years ago

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.

Mr-Kappelmann commented 4 months ago

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

jn-bedag commented 2 months ago

One problem here is that if you manually delete the "Default Web Site" before launching AutoSPInstaller, AutoSPInstaller creates the "SharePoint Web Services" site with the ID "1".
Then later, when AutoSPInstaller searches for the "Default Web Site" and tries to stop it, it also looks for a site with the ID "1" and therefore stops the "SharePoint Web Services" site.