arcgis-powershell-dsc
arcgis-powershell-dsc copied to clipboard
Documentation: Portal Content directory must exist, it will not be created
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
Module Version
4.2.0
Affected Resource(s)
- ArcGIS_Portal
Configuration Files
{
"AllNodes": [
{
"NodeName": "Svr1.email.com",
"Role": [
"Portal",
"DataStore",
"WebAdaptor"
],
"DataStoreTypes": [
"Relational"
],
"SslCertificates": [
{
"Path": "C:\\AWSSetup\\Cert.pfx",
"Password": "certPassword",
"CNameFQDN": "Svr1.email.com",
"Target": [
"Portal",
"WebAdaptor",
"DataStore"
]
}
],
"WebAdaptorConfig":[
{
"Role": "Portal",
"Context": "portal",
"WebSiteId": 1
}
]
}
],
"ConfigData": {
"Version": "11.2",
"ServerContext": "server",
"PortalContext": "portal",
"ServerRole": "GeneralPurposeServer",
"DownloadSetups": false,
"DownloadPatches": false,
"Credentials": {
"ServiceAccount": {
"UserName": "email\\svcAccount",
"Password": "adPass",
"IsDomainAccount": true,
"IsMSAAccount": false
},
"ADServiceUser": {
"UserName": "email\\svcAccount",
"Password": "adPass"
}
},
"DataStore": {
"ContentDirectoryLocation": "\\\\server.email.com\\share\\PROJECT\\ArcGISDataStore",
"EnableFailoverOnPrimaryStop": false,
"EnablePointInTimeRecovery": false,
"Installer": {
"Path": "C:\\AWSSetup\\ArcGIS_DataStore_Windows_112_188252.exe",
"InstallDir": "C:\\ArcGIS\\DataStore",
"InstallAllFeatures": false
}
},
"Portal": {
"LicenseFilePath": "C:\\AWSSetup\\portal_112.json",
"PortalLicenseUserTypeId": "creatorUT",
"Installer": {
"Path": "C:\\AWSSetup\\Portal_for_ArcGIS_Windows_112_188250.exe",
"WebStylesPath": null,
"InstallDir": "C:\\ArcGIS\\Portal",
"ContentDir": "C:\\ArcGISPortalDefault"
},
"ContentDirectoryLocation": "\\\\server.email.com\\share\\PROJECT\\Portal\\Content",
"EnableAutomaticAccountCreation": true,
"DefaultRoleForUser": "iAAAAAAAAAAAAAAA",
"DefaultUserLicenseTypeIdForUser": "viewerUT",
"PortalAdministrator": {
"UserName": "portaladmin",
"Email": "[email protected]",
"Password": "thePassword",
"SecurityQuestionIndex": 1,
"SecurityAnswer": "adfasdf"
},
"EmailSettings": {
"SMTPServerAddress": "[email protected]",
"From": "[email protected]",
"Label": "ArcGIS Portal",
"AuthenticationRequired": false,
"SMTPPort": 465,
"EncryptionMethod": "TLS"
},
"EnableHSTS": false
},
"WebAdaptor": {
"AdminAccessEnabled": true,
"OverrideHTTPSBinding": true,
"Installer": {
"Path": "C:\\AWSSetup\\ArcGIS_Web_Adaptor_for_Microsoft_IIS_112_188253.exe",
"IsSelfExtracting": true,
"WebDeployPath": "C:\\AWSSetup\\WebDeploy_amd64_en-US.msi",
"DotnetHostingBundlePath": "C:\\AWSSetup\\dotnet-hosting-6.0.25-win.exe"
}
}
}
}.
In this example the shared storage is on server.email.com and the main host is svr1.email.com that portal is installed onto.
Expected Behavior
- Portal content directory would be created, like the default one is if it does not exist. In this example that would be
\\server.email.com\share\PROJECT\Portal
which has filepaths up to\\server.email.com\share\PROJECT
created, but notPortal
, as I figured that the installer would create the site directory.
Actual Behavior
- It errors out saying cannot read from directory, because it was not created.
Trace-DSCJob : 1/16/2024 1:28:00 PM: PowerShell DSC resource ArcGIS_Portal failed to execute Set-TargetResource
functionality with error message: Cannot read from directory path
'\\server.email.com\share\PROJECT\Portal'. Please check that the location is valid and that the Portal
service account has permissions to the location.
At C:\Program Files\WindowsPowerShell\Modules\ArcGIS\4.2.0\ArcGIS.psm1:261 char:5
+ Trace-DSCJob -Job $Job -JobName $ConfigurationName -DebugMode $De ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Trace-DSCJob
Trace-DSCJob : 1/16/2024 1:28:00 PM: The SendConfigurationApply function did not succeed.
At C:\Program Files\WindowsPowerShell\Modules\ArcGIS\4.2.0\ArcGIS.psm1:261 char:5
+ Trace-DSCJob -Job $Job -JobName $ConfigurationName -DebugMode $De ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Trace-DSCJob
Steps to Reproduce
I have not tested making a brand new repro for this but for me it was:
- Run the above script with InstallLicenseConfigure, making sure ContentDir is on a shared filesystem that contains all folders until the /Portal one, which is where I'd like the content directory to be made
- Wait until it gets to the createSite step, which fails (this is probably a problem in ArcGIS Portal rather than DSC?)
- It fails in the createSite
Important Factoids
The documentation says this on the 4.2.0 variables page:
ContentDirectoryLocation - The path where content of your new site will be initialized. Generally, it is the ContentDir mentioned above, followed by \arcgisportal\content, but it can be a completely independent path as well. For a Single Machine Portal this can be a Local Path (Ex. same as ContentDir), but for 2 Machine Portal this needs to be a Shared Location.
which does not mention the directory must exist, even if this is a brand new portal being brought up.
Manually creating the directory made it work. However, the documentation does not make it clear it does, and behavior with other directories not existing and being created but not this one seems inconsistent.
References
N/A
Possible related issue: https://github.com/Esri/arcgis-powershell-dsc/issues/119
Thanks @mjperez-usgs for this suggestion. We have updated the v4.3.0 wiki variables page to include the following Note:
https://github.com/Esri/arcgis-powershell-dsc/wiki/v4.3.0-Variables-reference-page-for-JSON-configuration-files