Esri / arcgis-powershell-dsc

This repository contains scripts, code and samples for automating the install and configuration of ArcGIS (Enterprise and Desktop) using Microsoft Windows PowerShell DSC (Desired State Configuration).
Apache License 2.0
110 stars 61 forks source link

11.1 to 11.2 Upgrade: ArcGIS_License failed to execute Set-TargetResource SoftwareAuthorization.exe not found #507

Closed PartyPelican closed 4 months ago

PartyPelican commented 6 months ago

Community Note

Module Version

ArcGIS Module v4.2.0

Affected Resource(s)

ArcGIS_License

Configuration Files

{
  "AllNodes": [
    {
      "NodeName": "gis-svr",
      "Role": ["Server"],
      "SslCertificates": [
        {
          "Path": "C:\\Certs\\giscert.pfx",
          "Password": "PASSWORD",
          "CNameFQDN": "CNAMEFQDN",
          "Target": ["Server"]
        }
      ]
    },
    {
      "NodeName": "gis-ds",
      "DataStoreTypes": ["Relational"],
      "Role": ["DataStore"]
    },
    {
      "NodeName": "gis-wa",
      "Role": ["WebAdaptor"],
      "WebAdaptorConfig": [
    {
        "Role": "Portal"
    },
    {
        "Role": "Server"
    }
    ],
      "SslCertificates": [
        {
          "Path": "C:\\Certs\\giscert.pfx",
          "Password": "PASSWORD",
          "CNameFQDN": "CNAMEFQDN",
          "Target": ["WebAdaptor"]
        }
      ]
    },
    {
      "NodeName": "gis-ps",
      "Role": ["Portal"]
    }
  ],
  "ConfigData": {
    "Version": "11.2",
    "OldVersion": "11.1",
    "ServerContext": "server",
    "PortalContext": "portal",
    "ServerRole": "GeneralPurposeServer",
    "Credentials": {
      "ServiceAccount": {
        "Password": "PASSWORD",
        "UserName": "USERNAME",
        "IsDomainAccount": true,
        "IsMSAAccount": false
      }
    },
    "Server": {
      "LicenseFilePath": "C:\\licensefiles\\ArcGISGISServerStandard_ArcGISServer_1403162.prvc",
      "Installer": {
        "Path": "C:\\licensefiles\\ArcGIS_Server_Windows_112_188239.exe",
        "InstallDir": "E:\\ArcGIS\\Server",
        "InstallDirPython": "E:\\Python27"
      },
      "ServerDirectoriesRootLocation": "E:\\arcgisserver\\directories",
      "ConfigStoreLocation": "E:\\arcgisserver\\config-store",
      "PrimarySiteAdmin": {
        "UserName": "USERNAME",
        "Password": "PASSWORD"
      }
    },
    "Portal": {
      "LicenseFilePath": "C:\\licensefiles\\ArcGIS_Enterprise_Portal_112_440808_20231207.json",
      "PortalLicenseUserTypeId": "creatorUT",
      "Installer": {
        "Path": "C:\\licensefiles\\Portal_for_ArcGIS_Windows_112_188250.exe",
        "InstallDir": "E:\\ArcGIS\\Portal",
        "ContentDir": "E:\\arcgisportal"
      },
      "ContentDirectoryLocation": "E:\\arcgisportal\\content",
      "PortalAdministrator": {
        "UserName": "USERNAME",
        "Email": "EMAIL",
        "Password": "PASSWORD",
        "SecurityQuestionIndex": 13,
        "SecurityAnswer": "ANSWER"
      }
    },
    "DataStore": {
      "ContentDirectoryLocation": "E:\\arcgisdatastore",
      "EnableFailoverOnPrimaryStop": false,
      "Installer": {
        "Path": "C:\\licensefiles\\ArcGIS_DataStore_Windows_112_188252.exe",
        "InstallDir": "E:\\ArcGIS\\DataStore"
      }
    },
    "WebAdaptor": {
      "AdminAccessEnabled": true,
      "Installer": {
        "Path": "C:\\licensefiles\\ArcGIS_Web_Adaptor_for_Microsoft_IIS_112_188253.exe"
      }
    }
  }
}

Expected Behavior

Upgrade ArcGIS Server 11.1 to 11.2 and license.

Actual Behavior

12/11/2023 1:41:33 PM: PowerShell DSC resource ArcGIS_License failed to execute Set-TargetResource functionality with error message: E:\ArcGIS\Server\ E:\ArcGIS\Server\tools\SoftwareAuthorization\SoftwareAuthorization.exe not found 12/11/2023 1:41:33 PM: The SendConfigurationApply function did not succeed.

Server Upgrade Failed

Steps to Reproduce

  1. Deploy a ArcGIS Enterprise 11.1 on a multi-machine configuration.
  2. Upgrade from ArcGIS Enterprise 11.1 to 11.2 using powershell dsc version 4.2.0

Has anyone experienced this issue before? I appreciate any help. 2023-12-11_14-36-24

cameronkroeker commented 6 months ago

Hi @PartyPelican,

On the ArcGIS Server node, can you check if the following location exists?

E:\ArcGIS\Server\tools\SoftwareAuthorization\SoftwareAuthorization.exe

And can you also run this command and share the output?

Get-ArcGISProductDetails

Thanks, Cameron K.

PartyPelican commented 6 months ago

hmmm, interesting...

When the powershell dsc failed, I checked the path for the SoftwareAuthorization.exe on the server machine and it was present. However, after reverting back to my organizations working snapshot of the machine, that executable doesn't seem to be present. the only tools are in the photo I have attached. 2023-12-11_15-09-58

I've also attached the results of the Get-ProductDetails cmdlet. 2023-12-11_15-14-04

cameronkroeker commented 6 months ago

Hi @PartyPelican,

The SoftwareAuthorization.exe changed locations at 11.2, so you won't see it in the tools directory at 11.1. For example:

11.1 = C:\Program Files\Common Files\ArcGIS\bin\SoftwareAuthorization.exe 11.2 = C:\Program Files\ArcGIS\Server\tools\SoftwareAuthorization\SoftwareAuthorization.exe

Can you run this exact command instead?

(Get-ArcGISProductDetails -ProductName Server).InstallLocation

I suspect the output of this is showing 2 Install locations due to the Custom Data Feeds. I am wondering if this is causing the issue.

Thanks, Cameron K.

PartyPelican commented 6 months ago

Thank you for the quick replies @cameronkroeker

I've attached the result. 2023-12-11_15-28-23

cameronkroeker commented 6 months ago

Thank you for the quick replies @cameronkroeker

I've attached the result. 2023-12-11_15-28-23

@PartyPelican Thanks for sharing the result of the test and it confirms my original theory. This should resolve the issue:

Change: https://github.com/Esri/arcgis-powershell-dsc/blob/3d056fe815c68e9676789afe9d4ca71c05cefc8d/Modules/ArcGIS/ArcGIS.psm1#L3314

To:

-or ($ProductName -ieq "ArcGIS Server" -and -not($DisplayName -imatch "Deep Learning Libraries for ArcGIS Server") -and -not($DisplayName -imatch "Custom Data Feeds")) `

Note: This change will need to be made on each machine the module resides on, and the Invoke-ArcGISConfiguration command will need to be ran in a fresh powershell window.

PartyPelican commented 6 months ago

Hello @cameronkroeker,

thank you for the workaround. After replacing that line of code, the upgrade completed successfully. However, the custom data feeds the server was using no longer work. They were working prior to the upgrade but its unclear to me as to why they stopped working. I am going to poke around some more to see if I can find the cause. 2023-12-12_18-37-40

PartyPelican commented 6 months ago

Looks like the custom data feed version was not updated, is that something the powershell dsc could handle? or would I need to reinstall the custom data feed sdk post upgrade every time? 2023-12-12_18-42-04

cameronkroeker commented 6 months ago

Looks like the custom data feed version was not updated, is that something the powershell dsc could handle? or would I need to reinstall the custom data feed sdk post upgrade every time? 2023-12-12_18-42-04

Hi @PartyPelican,

The ArcGIS Module doesn't support installing or upgrading ArcGIS Server Custom Data Feeds. I assume it must've been manually installed/configured at 11.1, therefore it will need to manually be upgraded.

Thanks, Cameron K.

PartyPelican commented 6 months ago

@cameronkroeker

I uninstalled the 11.1 version of custom data feeds and then installed version 11.2; the CDF layers were loading correctly after that. Thank you for all the help.

cameronkroeker commented 4 months ago

Hi @PartyPelican,

This has been addressed in v4.2.1:

https://github.com/Esri/arcgis-powershell-dsc/releases/tag/v4.2.1

Thanks, Cameron K.