Esri / arcgis-cookbook

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

ArcGIS Pro 2.3, Cookbook 3.3.0 and Chef-client 13.8.0 #209

Closed azinsharaf closed 5 years ago

azinsharaf commented 5 years ago

I ran cmd as admin. That account has access to setup(archive) files.

The following arcgis-pro role returns the error. Please advise.

arcgis-pro.json

{
  "ms_dotnet" : {
    "v4" : {
      "version" : "4.5.1"
    }
  },
  "arcgis":{
    "repository":{
      "archives":"\\\\vsrvfsprod01\\Installs\\GIS\\ESRI_ArcGIS_Installs\\ArcGIS_Pro\\2.3\\Chef"
    },
    "pro":{
      "version":"2.3",
      "seat_preference":"Float",
      "allusers":"1",
      "software_class":"Professional",
      "authorization_type":"CONCURRENT_USE",
      "esri_license_host":"VSRVGISLICP"
    }
  },
  "run_list":[
    "recipe[arcgis-pro]"
  ]
}

returns this error:

Microsoft Windows [Version 10.0.17134.648]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>chef-solo -j C:\chef\roles\arcgis-pro.json
[2019-03-28T16:32:50-07:00] WARN: *****************************************
[2019-03-28T16:32:50-07:00] WARN: Did not find config file: C:/chef/client.rb, using command line options.
[2019-03-28T16:32:50-07:00] WARN: *****************************************
Starting Chef Client, version 13.8.0
resolving cookbooks for run list: ["arcgis-pro"]
Synchronizing Cookbooks:
  - arcgis-pro (3.3.0)
  - arcgis-repository (3.3.0)
  - windows (4.1.4)
  - aws (7.3.1)
Installing Cookbook Gems:

Running handlers:
[2019-03-28T16:33:08-07:00] ERROR: Running exception handlers
Running handlers complete
[2019-03-28T16:33:08-07:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 16 seconds
[2019-03-28T16:33:08-07:00] FATAL: Stacktrace dumped to c:/chef/local-mode-cache/cache/chef-stacktrace.out
[2019-03-28T16:33:08-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2019-03-28T16:33:08-07:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of bundle install ----
STDOUT:
STDERR: C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/rb-readline-0.5.5/lib/rbreadline.rb:1097:in `<module:RbReadline>': HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory (RuntimeError)
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/rb-readline-0.5.5/lib/rbreadline.rb:17:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/rb-readline-0.5.5/lib/readline.rb:10:in `<module:Readline>'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/rb-readline-0.5.5/lib/readline.rb:8:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:39:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb:2:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/line_editor.rb:2:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor/base.rb:8:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/vendor/thor/lib/thor.rb:2:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/vendored_thor.rb:7:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/friendly_errors.rb:4:in `<top (required)>'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/exe/bundle:21:in `<top (required)>'
        from C:/opscode/chef/embedded/bin/bundle:23:in `load'
        from C:/opscode/chef/embedded/bin/bundle:23:in `<main>'
---- End output of bundle install ----
Ran bundle install returned 1
cameronkroeker commented 5 years ago

Hi @azinsharaf,

The issue looks to be related to the HOME, HOMEDRIVE and/or HOMEPATH environment variable most likely for the account that was used to run the chef-solo command:

STDERR: C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/rb-readline-0.5.5/lib/rbreadline.rb:1097:in `': HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory (RuntimeError)

Using Windows PowerShell run the following command:

Get-ChildItem Env:

This should give a list of the environment variables. Check to see if HOME, HOMEDRIVE and HOMEPATH are set correctly (ensure they are both set and don't contain any special characters). Some of the following commands can be used to help fix:

Remove-Variable -Force HOME Set-Variable HOME "C:\Users(enter your username)"

There are a couple recommendations here.

azinsharaf commented 5 years ago
PS C:\WINDOWS\system32> Get-ChildItem Env:

HOMEDRIVE                      H:
HOMEPATH                       \

I can't modify it even with the Force option because it is read only . Could be the way our organization implements Windows. Trying to find a workaround.

azinsharaf commented 5 years ago

@cameronkroeker Just wondering if you have seen this issue in the past and can assist me on this.

cameronkroeker commented 5 years ago

@cameronkroeker Just wondering if you have seen this issue in the past and can assist me on this.

Hi @azinsharaf,

Is H: a mapped network drive? You may need to work with your IT department to have them change it. However, if that is not an option, there are a few "workarounds" mentioned in the following forum that perhaps might be viable options:

https://superuser.com/questions/255776/overriding-homedrive-and-homepath-as-a-windows-7-user

azinsharaf commented 5 years ago

This trick resolved the issue! Thank you @cameronkroeker

HOMEDRIVE Local Default If you do not need to access "Server" by name at all, you can cause the group policy setting to fail and fall back to your local machine. The easiest way to do this is to add an entry to C:\Windows\System32\drivers\etc\hosts like:

127.0.0.1 Server

After rebooting, you should see something like:

set HOME
HOMEDRIVE=C:
HOMEPATH=\Users\username