Esri / arcgis-cookbook

Chef cookbooks for ArcGIS
Apache License 2.0
300 stars 116 forks source link

Create site not happening through Chef but working through manual method #133

Closed srinivas-anant closed 6 years ago

srinivas-anant commented 6 years ago

I am automating the creation of ArcGIS servers through Chef and it is not able to create the site and it fails at creating the directories in the network share path, but when I create the site through the browser and give the network path everything works out and it gets created, this is the error I get through chef:

[2018-02-02T02:54:07-05:00] FATAL: RuntimeError: arcgis_enterprise_server[Create ArcGIS Server site] (arcgis-enterprise::server line 115) had an error: RuntimeError: Failed to create the site. The specified configuration store location is not accessible. Ensure that the ArcGIS Server account has read and write access to the location.

The ArcGIS server account has privileges to create files on the network share and the user is a domain user and I am using the user name in this format: mydomain\username

pbobov commented 6 years ago

arcgis-enterprise::server recipe does not create directories on network shares.

To create and share the server directories run arcgis-enterprise::fileserver recipe on the file server machine.

srinivas-anant commented 6 years ago

I am encountering an issue when I used the fileserver recipe:

default['arcgis']['fileserver'].tap do |fileserver|
   fileserver['shares'] = ['\\\\_ip_\\_share_name_\\arcgisportal\\']
end

The above is my atrribute file.

I am creating the files on the network share directly I am not mounting them anywhere:

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/PIDARC~1/AppData/Local/Temp/chef-script20180203-4824-12fbaym.ps1" ----
    STDOUT:
    STDERR: The syntax of this command is:
    NET SHARE
    sharename
              sharename=drive:path [/GRANT:user,[READ | CHANGE | FULL]]
                                   [/USERS:number | /UNLIMITED]
                                   [/REMARK:"text"]
                                   [/CACHE:Manual | Documents| Programs | BranchCache | None]
              sharename [/USERS:number | /UNLIMITED]
                        [/REMARK:"text"]
                        [/CACHE:Manual | Documents | Programs | BranchCache | None]
              {sharename | devicename | drive:path} /DELETE
              sharename \\computername /DELETE
    ---- End output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/PIDARC~1/AppData/Local/Temp/chef-script20180203-4824-12fbaym.ps1" ----
    Ran "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/PIDARC~1/AppData/Local/Temp/chef-script20180203-4824-12fbaym.ps1" returned 1
pbobov commented 6 years ago

Try to set the attributes for fileserver recipe like this:

{
  "arcgis": {
    "run_as_user": "arcgis",
    "run_as_password": "XXXXXXXXXXXXX",
    "fileserver": {
      "shares": ["C:\\arcgisserver", "C:\\arcgisdatastore", "C:\\arcgisportal"]
    },
    "server": {
      "local_directories_root": "C:\\arcgisserver"
    },
    "portal": {
      "local_content_dir": "C:\\arcgisportal\\content"
    },
    "data_store": {
      "local_backup_dir": "C:\\arcgisdatastore\\backup"
    }
  },
  "run_list": [
    "recipe[arcgis-enterprise::fileserver]"
  ]
}
srinivas-anant commented 6 years ago

Thanks Pavel.

But the thing is the shared drives are already created and the UNC path is given to me --> \10.25.25.15\Volume1 and on this I want to create the config stores and directories.

Why is that no permissions error coming in Chef but not when I manually create the site and pass the UNC for my shared drive and directories?

pbobov commented 6 years ago
RuntimeError: Failed to create the site. The specified configuration store location is not accessible. Ensure that the ArcGIS Server account has read and write access to the location.

For some reason the specified configuration store is not accessible form the domain user account.

If the config store path is the same in both cases, there should be no difference between the manual site creation and the one called by Chef.

srinivas-anant commented 6 years ago

I did this for portal it create the site doesn't throw the error for that. The domain user has been given access to use that network share.

pbobov commented 6 years ago

Set chef-client's log level to debug (-l debug) when you run chef-client. With debug logging enabled, Chef will log all the requests to ArcGIS Server Admin API. Compare the request to the manual one and try to create all the directories used in the createSite request.

srinivas-anant commented 6 years ago

I did this I used a directory resource to create the necessary directories on to the shared file and then let the node converge. Will this approach not help?

pbobov commented 6 years ago

Yes. That should help. You just need to know the exact paths of the directories used by createSite request.

srinivas-anant commented 6 years ago

Alright thanks! And also the new update to the server recipe cookbook is causing this weird error when authorizing the servers. In the run list I have mentioned the authorization_file_version is 10.5:

C:\Program Files (x86)\ESRI\License10.6\\keycodes not available Retrying software authorization.

Why is this happening? I am not using 10.6 anywhere.

kawenglou commented 6 years ago

I ran into the same issue today when I tried to test my wrapper against the v3.2 cookbook. It seems like you will have to override over node.['arcgis']['server']['keycodes'] with the correct path for 10.5.x:

node.default['arcgis']['server']['keycodes'] = ENV['ProgramW6432'] + "\\ESRI\\License#{node['your_wrapper']['arcgis']['version'].to_f}\\sysgen\\keycodes"

I am pretty new to Chef so my understanding is probably wrong. But it seems like the the precedence is preventing the attribute from being set correctly, so it will always default to 10.6.

srinivas-anant commented 6 years ago

@kawenglou - Thanks the above method you suggested worked well!

@pbobov - How do I compare the request to the manual one and try to create all the directories used in the createSite request? I did the debug level but the request was encoded in format that's not understandable, is there a documentation I can refer to for the request?