Esri / arcgis-cookbook

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

Server authorization is getting skipped then fails at site creation with message machine does not have a valid license #284

Closed anandak closed 3 years ago

anandak commented 3 years ago

Trying to do a fresh base enterprise deployment of 10.8.1 on a single machine using v3.7.0. Portal gets installed correctly, but fails at Server site creation with message "Machine does not have a valid license". The logs say that authorization step of Server is getting skipped. It used to work seamlessly with v3.6.1. I am not able to work out why the authorization step is getting skipped! Any pointers on where I should look?

image

Here is the role json file we are using.

{
    "name": "AWS-machine_BED_Primary",
    "description": "BED_Primary",
    "default_attributes": {
        "arcgis": {
            "version": "10.8.1",
            "run_as_user": "xxxx",
            "run_as_password": "xxx",
            "hosts": {
                "AWS-machine.domain.com": "172.30.51.123",
                "AWS-machine2.domain.com": "172.30.51.125",
            },
            "cache_authorization_files": false,
            "configure_windows_firewall": true,
            "iis": {
                "keystore_file": "\\\\AWS-machine\\arcgis-repo\\SSL_Certificates\\domain\\domain_19-21.pfx",
                "keystore_password": "123",
                "replace_https_binding": true
            },
            "web_adaptor": {
                "setup_archive": "\\\\AWS-machine\\arcgis-repo\\ArcGIS_Setups\\ArcGIS_Web_Adaptor_for_Microsoft_IIS_1081_175217.exe",
                "admin_access": true
            },
            "data_store": {
                "preferredidentifier": "hostname",
                "hostidentifier": "AWS-machine.domain.com",
                "setup_archive": "\\\\AWS-machine\\arcgis-repo\\ArcGIS_Setups\\ArcGIS_DataStore_Windows_1081_175216.exe",
                "install_dir": "C:\\Program Files\\ArcGIS\\DataStore",
                "data_dir": "C:\\arcgisdatastore\\data",
                "backup_dir": "\\\\AWS-machine\\fileserver\\arcgisdatastore",
                "relational": {
                    "backup_location": "\\\\AWS-machine\\fileserver\\arcgisdatastore\\relational"
                },
                "tilecache": {
                    "backup_location": "\\\\AWS-machine\\fileserver\\arcgisdatastore\\tileCache"
                },
                "install_system_requirements": true,
                "configure_autostart": true,
                "types": "relational,tileCache"
            },
            "server": {
                "domain_name": "AWS-machine.domain.com",
                "hostname": "AWS-machine.domain.com",
                "url": "https://AWS-machine.domain.com:6443/arcgis",
                "private_url": "https://AWS-machine.domain.com:6443/arcgis",
                "wa_url": "https://AWS-machine.domain.com/server",
                "system_properties": {
                    "WebContextURL": "https://AWS-machine.domain.com:8080/server"
                },
                "web_context_url": "https://AWS-machine.domain.com:8080/server",
                "admin_username": "xxx",
                "admin_password": "xxx",
                "setup_archive": "\\\\AWS-machine\\arcgis-repo\\ArcGIS_Setups\\ArcGIS_Server_Windows_1081_175203.exe",
                "install_dir": "C:\\Program Files\\ArcGIS\\Server",
                "authorization_file": "\\\\AWS-machine\\arcgis-repo\\Server_License_File\\ArcGISGISServerAdvanced_ArcGISServer_1008053_developer_20220216.prvc",
                "install_system_requirements": true,
                "directories_root": "\\\\AWS-machine\\fileserver\\generalserver",
                "is_hosting": true,
                "config_store_type": "FILESYSTEM",
                "config_store_connection_string": "\\\\AWS-machine\\fileserver\\generalserver",
                "keystore_file": "\\\\AWS-machine\\arcgis-repo\\SSL_Certificates\\domain\\domain_19-21.pfx",
                "keystore_password": "123",
                "wa_name": "server"
            },
            "python": {
                "install_dir": "C:\\Python27"
            },
            "portal": {
                "domain_name": "AWS-machine.domain.com",
                "hostname": "AWS-machine.domain.com",
                "hostidentifier": "AWS-machine.domain.com",
                "preferredidentifier": "hostname",
                "url": "https://AWS-machine.domain.com:7443/arcgis",
                "private_url": "https://AWS-machine.domain.com:7443/arcgis",
                "wa_url": "https://AWS-machine.domain.com/portal",
                "web_context_url": "https://AWS-machine.domain.com:8080/portal",
                "admin_username": "xxx",
                "admin_password": "xxx",
                "admin_email": "user.name@domain.com",
                "security_question": "Your favorite ice cream flavor?",
                "security_question_answer": "vanilla",
                "setup_archive": "\\\\AWS-machine\\arcgis-repo\\ArcGIS_Setups\\Portal_for_ArcGIS_Windows_1081_175214.exe",
                "install_dir": "C:\\Program Files\\ArcGIS\\Portal",
                "data_dir": "C:\\arcgisportal",
                "authorization_file": "\\\\AWS-machine\\arcgis-repo\\Portal_License_File\\ArcGIS_Enterprise_Portal_1081_342323_20210218_developer_20220216.json",
                "user_license_type_id": "creatorUT",
                "install_system_requirements": true,
                "content_store_type": "fileStore",
                "content_store_provider": "FileSystem",
                "content_store_connection_string": "\\\\AWS-machine\\fileserver\\arcgisportal",
                "keystore_file": "\\\\AWS-machine\\arcgis-repo\\SSL_Certificates\\domain\\domain_19-21.pfx",
                "keystore_password": "xxx",
                "wa_name": "portal",
                "system_properties": {
                    "WebContextURL": "https://AWS-machine.domain.com:8080/portal"
                }
            }
        }
    },
    "run_list": [
        "recipe[arcgis-enterprise::system]",
        "recipe[arcgis-enterprise::hosts]",
        "recipe[esri-iis]",
        "recipe[arcgis-enterprise::portal]",
        "recipe[arcgis-enterprise::portal_wa]",
        "recipe[arcgis-enterprise::server]",
        "recipe[arcgis-enterprise::server_wa]",
        "recipe[arcgis-enterprise::datastore]",
        "recipe[arcgis-enterprise::federation]"
    ]
}
cameronkroeker commented 3 years ago

Hi @anandak,

Looks like it's skipping the server authorization due to the following not_if statement:

https://github.com/Esri/arcgis-cookbook/blob/f973da68d5d092ebedc005bc9b79611e5aa5aaba/cookbooks/arcgis-enterprise/recipes/server.rb#L33-L35

Perhaps the authorization file was cached from previous runs when using v3.6.1, and v3.7.0 is picking up on the cached location?

I recommend checking C:\chef\cache directory. Try clearing both the cache directory and nodes directory, then re-run.

Thanks!

anandak commented 3 years ago

Hi @cameronkroeker , that was an excellent catch! We did find the auth file cached from previous runs in chef's cache directory. Once we deleted the file, authorization was getting executed.

Note: Another thing we found that is working differently in v3.7.0 as compared to v3.6.1 is that we need to specify the authorization file version attribute. Especially in our case, we are installing 10.8.1, but the version specified in the prvc file is 10.8. This could be because we are using a developer subscription license which is valid for 10.8 as well as 10.8.1 but when we downloaded it from my.esri it had the line \\version=10.8. With v.3.6.1 it was running okay even without specifying the auth_file_version attribute.

cameronkroeker commented 3 years ago

Thanks @anandak glad to hear clearing the chef cache resolved the issue.