Esri / arcgis-cookbook

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

How to upgrade web adaptors using chef script #304

Closed Ayushyadav19 closed 1 year ago

Ayushyadav19 commented 2 years ago

Hi,

As per the Esri documentation https://enterprise.arcgis.com/en/web-adaptor/latest/install/iis/install-arcgis-web-adaptor-portal.htm to upgrade the web adaptor to the new version we need to uninstall and re-install the web adaptors having the same name.

And the template which is provided to upgrade the ArcGIS base enterprise. https://github.com/Esri/arcgis-cookbook/wiki/Upgrade-an-existing-single-machine-base-ArcGIS-Enterprise-deployment. We need to replace the setups and licenses path only. My question is whether replacing the paths for setups and licenses will upgrade the web adaptor as per the Esri documentation or we need to change/modify the run list.

Please provide me with the upgrade template for upgrading web adaptors to version 10.9.1

Any recommendation/resolution will be highly appreciated.

cameronkroeker commented 2 years ago

Hi @Ayushyadav19,

The arcgis-enterprise::portal_wa and arcgis-enterprise::server_wa recipes will automatically upgrade the web adaptor by first uninstalling the previous version of the web adaptor and installing/configuring the new version.

Here are the upgrade templates for a single machine or highly available base Enterprise (upgrades portal/server/datastore/webadaptor):

https://github.com/Esri/arcgis-cookbook/tree/master/templates/arcgis-enterprise-base/10.9.1#upgrade-workflow

Here are the Web Adaptor upgrade templates for distributed deployment models:

https://github.com/Esri/arcgis-cookbook/tree/master/templates/arcgis-webadaptor/10.9.1#upgrade-workflow

Thanks, Cameron K.

Ayushyadav19 commented 2 years ago

Hi Cameron, Thanks for providing us with the templates. We are upgrading the distributed ArcGIS Enterprise 10.8.1 to 10.9.1 using a chef server. Our chef-client version is 14.14.29. When we are trying to upgrade the environment to 10.9,1 we are facing an issue the chef-client is unable to upgrade Portal for ArcGIS it just bypasses all the recipes mentioned in the role file by logging a message as "up to date". image

As mentioned in the Chef Client Compatibility Matrix it is recommended to use chef-client 16.16.13 having the latest version of cookbooks. I want to know a few things:-

  1. Can we use chef-client 14.14.29 or do we need to upgrade this to 16.16.13 and
  2. Whether version 16.16.13 is an open-source version of chef-client or not
  3. Are we missing out on something in the role file or anything else from the chef server side. I have attached a screenshot having the recipes in our role file image

Please help me out with this. Any help will be highly appreciated.

cameronkroeker commented 2 years ago

Hi @Ayushyadav19,

The items that are being skipped I would expect to be skipped, except perhaps the unpack action. This could be getting skipped for a couple different reasons.

The unpack action gets skipped if the setup archive has already been unpacked, or the arcgis.portal.setup_archive or arcgis.repository.archives isn't found/contains incorrect filename, or your using the arcgis.portal.setup attribute that points to the Setup.exe that's already extracted.

Could you share the full Chef run log, and json file? Feel free to scrub out any sensitive information such as hostnames, passwords, etc.

In cookbooks v3.8.0, we support Chef Client 13 and above: https://github.com/Esri/arcgis-cookbook/blob/1c7f39341a4a967c6c73a20ee0b6bbb5b2a3dc53/cookbooks/arcgis-enterprise/metadata.rb#L8

The reason we recommend version 16 is because this is what the cookbooks were certified\tested against just prior to release. However, there shouldn't be anything in the cookbooks that will block or prevent you from using Chef v14.

Keep in mind that Chef Infra was bought out by a different company (Progress), and starting with Chef 15+ they've changed the licensing model. However, there is an open source, "free" alternative called Cinc:

https://cinc.sh

Cinc client starts with version 15, and Cinc Server is still in pre-release. So if you heavily rely on Chef Server, then it might be best to keep using it with Chef 14, until Cinc Server has been fully released.

Thanks, Cameron K.

Ayushyadav19 commented 2 years ago

Hi Cameron,

Thank you for your time and for providing this information. Yes, you are right the unpacking of the setups will be skipped as the setup is already been extracted in the first run. My concern point is on the action install where it should upgrade the portal to 10.9.1 as we have provided the 10.9.1 setup and licenses path in the role file. However, when it comes to action install it waits for 25-30 secs and bypasses the install action. I assume that it should wait for at least half an hour and upgraded the portal in the backend.

I have attached the portal role file and the log file after redacting all the sensitive information. Please let me know any questions Portal logs.zip

cameronkroeker commented 2 years ago

Hi @Ayushyadav19,

Thanks for providing the json and logs. Looks like the portal install isn't being skipped but rather exiting silently without an error.

[2022-03-21T11:08:28+00:00] INFO: Processing arcgis_enterprise_portal[Install Portal for ArcGIS] action install (arcgis-enterprise::install_portal line 53)
[2022-03-21T11:09:12+00:00] INFO: arcgis_enterprise_portal[Install Portal for ArcGIS] sending create action to template[C:\Chef\misc_scripts/install_portal.bat] (immediate)

Furthermore the setup must've not completed because v10.81 is still being returned and portal isn't in upgrade mode:

[2022-03-21T11:09:12+00:00] DEBUG: Response: 200 {"isPostUpgrade":false,"isLicensePopulated":true,"siteKey":"c4b79eb7-9c99-49aa-826b-122d38yyy75f","resources":["license","system","security","federation","logs","machines","license","mode","privilege"],"isPortalLicensed":true,"isLicenseFileRequired":false,"isUserTypeLicensing":true,"version":"10.8.1"}

This makes me think the 10.9.1 setup.exe exited silently without an error, but truly is failing. Could you check the Windows Event Application logs between 11:08:28 and 11:09:12? There should be hints or clues as to why the portal setup.exe is failing.

Additionally you can add the following attribute to your json file, and re-run chef, which will capture an msi install log:

"arcgis":{
   "portal": {
       "setup_options":"/L*v C:\\Portal_Install.log"
   }
}

Thanks, Cameron K.

Ayushyadav19 commented 2 years ago

Hi Cameron,

I check the Windows Event Application logs between 11:08:28 and 11:09:12 and found an error i.e. _Product: Portal for ArcGIS 10.9.1 -- Error 28809. Could not validate the credentials for account Domain\ArcGISService. Confirm the credentials are correct and attempt the installation again. The setup will now exit.

I have double and triple-checked the credentials for the ArcGIS_Service account and it is correct. Using the same ArcGIS_Service account credentials I logged in to the machine and tried to run the setup manually and encounter the below error. image

I have found an ESRI blog related to the above error :- https://support.esri.com/en/technical-article/000012113 Additionally, I have added "_setup_options":"/L*v C:\PortalInstall.log" in the role. I am attaching the Portal_Install.log file below please have a look is there anything going wrong. Portal_Install.log

Thanks Ayush Y

cameronkroeker commented 2 years ago

Hi @Ayushyadav19,

Thanks for providing the additional logs. I am not quite sure why the portal setup is not detecting that the domain service account is valid especially since you are able to log into the machine with the same account, therefore I recommend that you contact Esri Technical Support for further assistance with troubleshooting it.

https://support.esri.com/en/contact-tech-support

Thanks, Cameron K.

Ayushyadav19 commented 2 years ago

Hi @cameronkroeker

Thanks for helping us out and getting deep down to get the root cause of the failure. I will contact the ESRI customer support team for further assistance and troubleshooting.

Thanks Ayush