Esri / arcgis-cookbook

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

Error setting up HTTPS #38

Closed mojoflux closed 4 years ago

mojoflux commented 8 years ago

I've been tinkering around with this for a bit now but keep getting stuck on the 'action :configure_https' section. It goes through the IIS setup, generates the personal certificate without any issues, goes through the Server install, and then...this:

================================================================================
    Error executing action `configure_https` on resource 'arcgis_server[Configure HTTPS]'
    ================================================================================

    Errno::ENOENT
    -------------
    No such file or directory -

    Cookbook Trace:
    ---------------
    C:\chef\cookbooks\arcgis\providers\server.rb:265:in `block in class_from_file'

    Resource Declaration:
    ---------------------
    # In C:\chef\cookbooks\arcgis\recipes\server.rb

     65: arcgis_server 'Configure HTTPS' do
     66:   server_url node['arcgis']['server']['local_url']
     67:   username node['arcgis']['server']['admin_username']
     68:   password node['arcgis']['server']['admin_password']
     69:   keystore_file node['arcgis']['server']['keystore_file']
     70:   keystore_password node['arcgis']['server']['keystore_password']
     71:   cert_alias node['arcgis']['server']['cert_alias']
     72:   retries 5
     73:   retry_delay 30
     74:   not_if { node['arcgis']['server']['keystore_file'].nil? }
     75:   action :configure_https
     76: end

    Compiled Resource:
    ------------------
    # Declared in C:\chef\cookbooks\arcgis\recipes\server.rb:65:in `from_file'

    arcgis_server("Configure HTTPS") do
      action [:configure_https]
      retries 5
      retry_delay 30
      default_guard_interpreter :default
      declared_type :arcgis_server
      cookbook_name :arcgis
      recipe_name "server"
      server_url "http://Training:6080/arcgis"
      username "siteadmin"
      password "password"
      cert_alias "Training"
      not_if { #code block }
    end

Running handlers:
[2016-03-17T16:07:56+11:00] ERROR: Running exception handlers
Running handlers complete
[2016-03-17T16:07:56+11:00] ERROR: Exception handlers complete
Chef Client failed. 20 resources updated in 03 minutes 52 seconds
[2016-03-17T16:07:56+11:00] FATAL: Stacktrace dumped to C:/chef/cache/chef-stacktrace.out
[2016-03-17T16:07:56+11:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-03-17T16:07:56+11:00] FATAL: Errno::ENOENT: arcgis_server[Configure HTTPS] (arcgis::server line 65) had an error: Errno::ENOENT: No such file or directory

Any ideas what I'm doing wrong?

pbobov commented 8 years ago

Remove "cert_alias" : "Training" from "server" attributes in the JSON. If cert_alias attribute is specified, Chef looks for keystore_file, and it is not set.

mojoflux commented 8 years ago

Thanks Pavel, I think I'm getting the wrong end of the stick though.

The "cert_alias" : "Training" is being inherited from something, I've tried commenting out the line cert_alias = admin_client.get_server_ssl_certificate(machine_name) in C:\chef\cookbooks\arcgis\providers\server.rb as that's where it appears it's defined, but it's still giving errors.

Is there anywhere in particular I should be setting up for a self-signed certificate install?

pbobov commented 8 years ago

If you don't specify cert_alias and keystore_file in "server" attributes, Chef should not try to install the certificate on server. By default server already uses a self-signed certificate for HTTPs listener, so arcgis cookbook does not support generating certificates for server.

I'm not sure where the cookbook inherits "Training" from. The default value for server cert_alias is the server domain name (FQDN of the machine by default) .

mojoflux commented 8 years ago

Thanks Pavel, I've realised where my error was coming from though, feel like an idiot!

I forgot to remove the comma from the previous line in webgis-server.json after removing the keystore lines.

thanks!