Esri / arcgis-cookbook

Chef cookbooks for ArcGIS
Apache License 2.0
290 stars 115 forks source link

web styles fails extracting for ARCGIS Enterprise 11.2 #378

Closed rreilly-edr closed 6 months ago

rreilly-edr commented 6 months ago

Installed with the below JSON file, gives the error "no implicit conversion of nil into String" as I think it is not properly finding the path for the installer. it finds the portal setups/installer files no problem they are in the same location. I know there are soem things that probably need to be tweaked in the config below but we are iterating our way though it and are stuck with this error. windows server 2022 datacenter

{
  "arcgis": {
    "version": "11.2",
    "run_as_user": "xx", 
    "run_as_password": "xx",
    "configure_windows_firewall": true,
    "repository": {
      "archives": "D:\\Software\\Archives",
      "setups": "D:\\Software\\Setups"
    },
    "server": {
      "install_dir": "D:\\Program Files\\ArcGIS\\Server",
      "install_system_requirements": true,
      "wa_name": "server",
      "authorization_file": "C:\\Users\\xx\\chef-repo\\cookbooks\\ArcGISDISServerStandard_ArcGISServer_1382892.prvc"

    },
    "web_adaptor": {
      "install_system_requirements": true,
      "dotnet_setup_path": "D:\\Software\\Archives\\dotnet-hosting-6.0.9-win.exe",
      "web_deploy_setup_path": "D:\\Software\\Archives\\WebDeploy_amd64_en-US.msi",
      "admin_access": true,
      "reindex_portal_content": false
    },
    "data_store": {
      "install_dir": "D:\\Program Files\\ArcGIS\\DataStore",
      "setup_options": "ADDLOCAL=relational,tilecache",
      "data_dir": "D:\\arcgisdatastore",
      "install_system_requirements": true,
      "preferredidentifier": "hostname"
    },
    "webstyles": {
      "archives": "D:\\Software\\Archives",
      "setups": "D:\\Software\\Setups"
    },
    "portal": {
      "install_dir": "D:\\Program Files\\ArcGIS\\Portal",
      "install_system_requirements": true,
      "data_dir": "D:\\arcgisportal",
      "wa_name": "portal"
    }
  },
  "run_list": [
    "recipe[arcgis-enterprise::system]",
    "recipe[esri-iis::install]",
    "recipe[arcgis-enterprise::install_portal]",
    "recipe[arcgis-enterprise::start_portal]",
    "recipe[arcgis-enterprise::webstyles]",
    "recipe[arcgis-enterprise::install_portal_wa]",
    "recipe[arcgis-enterprise::install_server]",
    "recipe[arcgis-enterprise::start_server]",
    "recipe[arcgis-enterprise::install_server_wa]",
    "recipe[arcgis-enterprise::install_datastore]",
    "recipe[arcgis-enterprise::start_datastore]"
  ]
}

Here is the error, i did run in debug mode but was not able to get anymore pertanent info

Recipe: arcgis-enterprise::webstyles
  * arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles] action unpack

    ================================================================================
    Error executing action `unpack` on resource 'arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles]'
    ================================================================================

    TypeError
    ---------
    no implicit conversion of nil into String

    Cookbook Trace:
    ---------------
    C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb:24:in `exist?'
    C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb:24:in `block (2 levels) in from_file'

    Resource Declaration:
    ---------------------
    # In C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb

     20: arcgis_enterprise_webstyles 'Unpack ArcGIS Web Styles' do
     21:   setup_archive node['arcgis']['webstyles']['setup_archive']
     22:   setups_repo node['arcgis']['repository']['setups']
     23:   run_as_user node['arcgis']['run_as_user']
     24:   only_if { ::File.exist?(node['arcgis']['webstyles']['setup_archive']) &&
     25:             !::File.exist?(node['arcgis']['webstyles']['setup']) }
     26:   if node['platform'] == 'windows'
     27:     not_if { Utils.product_installed?(node['arcgis']['webstyles']['product_code']) }
     28:   else
     29:     not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'],
     30:                                                 node['hostname'],
     31:                                                 node['arcgis']['version'],
     32:                                                 :ArcGISPortal_WebStyles) }
     33:   end
     34:   action :unpack

    Compiled Resource:
    ------------------
    # Declared in C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb:20:in `from_file'

    arcgis_enterprise_webstyles("Unpack ArcGIS Web Styles") do
      action [:unpack]
      default_guard_interpreter :default
      declared_type :arcgis_enterprise_webstyles
      cookbook_name "arcgis-enterprise"
      recipe_name "webstyles"
      setup_archive nil
      setups_repo "D:\\Software\\Setups"
      run_as_user "arcgis"
      not_if { #code block }
      only_if { #code block }
    end

    System Info:
    ------------
    chef_version=16.1.16
    platform=windows
    platform_version=10.0.20348
    ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32]
    program_name=C:/opscode/chef/bin/chef-client
    executable=C:/opscode/chef/bin/chef-client

Running handlers:
[2024-01-02T21:19:04+00:00] ERROR: Running exception handlers
Running handlers complete
[2024-01-02T21:19:04+00:00] ERROR: Exception handlers complete
Chef Infra Client failed. 2 resources updated in 01 minutes 05 seconds
[2024-01-02T21:19:05+00:00] FATAL: Stacktrace dumped to C:/chef/cache/chef-stacktrace.out
[2024-01-02T21:19:05+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2024-01-02T21:19:05+00:00] FATAL: TypeError: arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles] (arcgis-enterprise::webstyles line 20) had an error: TypeError: no implicit conversion of nil into String
cameronkroeker commented 6 months ago

Hi @rreilly-edr,

Can you try removing the arcgis.webstyles block?

"webstyles": {
   "archives": "D:\\Software\\Archives",
   "setups": "D:\\Software\\Setups"
}

This is not needed because arcgis.repository.archives attribute is defined.

Thanks, Cameron K.

rreilly-edr commented 6 months ago

Hi @cameronkroeker i did rerun it without the webstyles extra attributes, fails with same error. I only added those while i was debugging and realized after diggining into the code that is was using the arcgis repo attributes, which is how is configured the first time it failed.

  * arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles] action unpack

    ================================================================================
    Error executing action `unpack` on resource 'arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles]'
    ================================================================================

    TypeError
    ---------
    no implicit conversion of nil into String

    Cookbook Trace:
    ---------------
    C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb:24:in `exist?'
    C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb:24:in `block (2 levels) in from_file'

    Resource Declaration:
    ---------------------
    # In C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb

     20: arcgis_enterprise_webstyles 'Unpack ArcGIS Web Styles' do
     21:   setup_archive node['arcgis']['webstyles']['setup_archive']
     22:   setups_repo node['arcgis']['repository']['setups']
     23:   run_as_user node['arcgis']['run_as_user']
     24:   only_if { ::File.exist?(node['arcgis']['webstyles']['setup_archive']) &&
     25:             !::File.exist?(node['arcgis']['webstyles']['setup']) }
     26:   if node['platform'] == 'windows'
     27:     not_if { Utils.product_installed?(node['arcgis']['webstyles']['product_code']) }
     28:   else
     29:     not_if { EsriProperties.product_installed?(node['arcgis']['run_as_user'],
     30:                                                 node['hostname'],
     31:                                                 node['arcgis']['version'],
     32:                                                 :ArcGISPortal_WebStyles) }
     33:   end
     34:   action :unpack

    Compiled Resource:
    ------------------
    # Declared in C:/chef/cache/cookbooks/arcgis-enterprise/recipes/webstyles.rb:20:in `from_file'

    arcgis_enterprise_webstyles("Unpack ArcGIS Web Styles") do
      action [:unpack]
      default_guard_interpreter :default
      declared_type :arcgis_enterprise_webstyles
      cookbook_name "arcgis-enterprise"
      recipe_name "webstyles"
      setup_archive nil
      setups_repo "D:\\Software\\Setups"
      run_as_user "arcgis"
      not_if { #code block }
      only_if { #code block }
    end

    System Info:
    ------------
    chef_version=16.1.16
    platform=windows
    platform_version=10.0.20348
    ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32]
    program_name=C:/opscode/chef/bin/chef-client
    executable=C:/opscode/chef/bin/chef-client

Running handlers:
[2024-01-04T15:31:12+00:00] ERROR: Running exception handlers
Running handlers complete
[2024-01-04T15:31:12+00:00] ERROR: Exception handlers complete
Chef Infra Client failed. 2 resources updated in 01 minutes 14 seconds
[2024-01-04T15:31:12+00:00] FATAL: Stacktrace dumped to C:/chef/cache/chef-stacktrace.out
[2024-01-04T15:31:12+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2024-01-04T15:31:12+00:00] FATAL: TypeError: arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles] (arcgis-enterprise::webstyles line 20) had an error: TypeError: no implicit conversion of nil into String

JSON

here is the json

{
  "arcgis": {
    "version": "11.2",
    "run_as_user": "xx", 
    "run_as_password": "xx",
    "configure_windows_firewall": true,
    "repository": {
      "archives": "D:\\Software\\Archives",
      "setups": "D:\\Software\\Setups"
    },
    "server": {
      "install_dir": "D:\\Program Files\\ArcGIS\\Server",
      "install_system_requirements": true,
      "wa_name": "server",
      "authorization_file": "C:\\Users\\rreillyex\\chef-repo\\cookbooks\\ArcGISDISServerStandard_ArcGISServer_1382892.prvc"

    },
    "web_adaptor": {
      "install_system_requirements": true,
      "dotnet_setup_path": "D:\\Software\\Archives\\dotnet-hosting-6.0.9-win.exe",
      "web_deploy_setup_path": "D:\\Software\\Archives\\WebDeploy_amd64_en-US.msi",
      "admin_access": true,
      "reindex_portal_content": false
    },
    "data_store": {
      "install_dir": "D:\\Program Files\\ArcGIS\\DataStore",
      "setup_options": "ADDLOCAL=relational,tilecache",
      "data_dir": "D:\\arcgisdatastore",
      "install_system_requirements": true,
      "preferredidentifier": "hostname"
    },
    "portal": {
      "install_dir": "D:\\Program Files\\ArcGIS\\Portal",
      "install_system_requirements": true,
      "data_dir": "D:\\arcgisportal",
      "wa_name": "portal"
    }
  },
  "run_list": [
    "recipe[arcgis-enterprise::system]",
    "recipe[esri-iis::install]",
    "recipe[arcgis-enterprise::install_portal]",
    "recipe[arcgis-enterprise::start_portal]",
    "recipe[arcgis-enterprise::webstyles]",
    "recipe[arcgis-enterprise::install_portal_wa]",
    "recipe[arcgis-enterprise::install_server]",
    "recipe[arcgis-enterprise::start_server]",
    "recipe[arcgis-enterprise::install_server_wa]",
    "recipe[arcgis-enterprise::install_datastore]",
    "recipe[arcgis-enterprise::start_datastore]"
  ]
}
cameronkroeker commented 6 months ago

Hi @rreilly-edr,

The json looks fine. I am honestly not quite sure why or what can be causing setup_archive nil. The setup_archive should be getting set to D:\Software\Archives\Portal_for_ArcGIS_Web_Styles_Windows_112_188251.exe from here:

https://github.com/Esri/arcgis-cookbook/blob/a6140542a084fc81e90bfa2e8e9d97a734651c7c/cookbooks/arcgis-enterprise/attributes/webstyles.rb#L27-L29

Some suggestions:

Thanks, Cameron K.

rreilly-edr commented 6 months ago

@cameronkroeker OK cleared chef-cache, downloaded the cookbooks form link. here is the info about the files unfortunetly still getting same error .. running as administrator so has acces to files, i ran is debug but did not see anything interesting,

PS D:\Software\Archives> ls

    Directory: D:\Software\Archives

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        12/12/2023   8:37 PM     1750330264 ArcGIS_DataStore_Windows_112_188252.exe
-a----        12/19/2023   3:24 PM     3604201728 ArcGIS_Server_Windows_112_188239.exe
-a----        12/12/2023   8:37 PM       46940216 ArcGIS_Web_Adaptor_for_Microsoft_IIS_112_188253.exe
-a----          1/2/2024   8:31 PM     1410003824 Portal_for_ArcGIS_Web_Styles_Windows_112_188251.exe
-a----        12/12/2023   8:38 PM     4159525832 Portal_for_ArcGIS_Windows_112_188250.exe

PS D:\Software\Archives> Get-FileHash -Path D:\Software\Archives\Portal_for_ArcGIS_Web_Styles_Windows_112_188251.exe -Algorithm sha256 | Format-List

Algorithm : SHA256
Hash      : 39F1647F53B5058C266125FC56C7BA0FC4FBBDF6A73CE34A527E12F630352241
Path      : D:\Software\Archives\Portal_for_ArcGIS_Web_Styles_Windows_112_188251.exe
rreilly-edr commented 6 months ago

@cameronkroeker i went back though made sure everything was uninstalled, it will not extract the setups for any of the products. I manually extractred them and re ran and it installs portal no problem gets to webstyles and fails to unpack. it should not be unpacking if the files exist, which they do

PS C:\> ls 'D:\Software\Setups\ArcGIS 11.2\ArcGISWebStyles\'

    Directory: D:\Software\Setups\ArcGIS 11.2\ArcGISWebStyles

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          1/5/2024   4:00 PM                SetupFiles
-a----        10/13/2023   6:26 PM        2242208 Setup.exe

it should only unpack if the archive exists and the setup does not correct ?

only_if { ::File.exist?(node['arcgis']['webstyles']['setup_archive']) &&
            !::File.exist?(node['arcgis']['webstyles']['setup']) }
cameronkroeker commented 6 months ago

it should only unpack if the archive exists and the setup does not correct ?

only_if { ::File.exist?(node['arcgis']['webstyles']['setup_archive']) &&
            !::File.exist?(node['arcgis']['webstyles']['setup']) }

Yes, that is correct. Honestly, I am quite puzzled at what could be the culprit here. Using your json file above with the same Chef Client version of 16.1.16 on Windows Server 2022 it succeeds. I also ensured to use D:\Software\Archives.

First run where WebStyles was not yet extracted:

Recipe: arcgis-enterprise::webstyles
  * arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles] action unpack
  * arcgis_enterprise_webstyles[Install ArcGIS Web Styles] action install

Second run where WebStyles was already extracted:

Recipe: arcgis-enterprise::webstyles
  * arcgis_enterprise_webstyles[Unpack ArcGIS Web Styles] action unpack (skipped due to only_if)
  * arcgis_enterprise_webstyles[Install ArcGIS Web Styles] action install

Are you able to try it on another machine?

Thanks, Cameron K.

rreilly-edr commented 6 months ago

I will destroy and recreate and try the deployment again, will post update.

rreilly-edr commented 6 months ago

Got past the issue by recreating the server and redeploying. thanks for the help @cameronkroeker