Error 'Cannot validate Model Manager Web host. The remote server returned an error: (500) Internal Server Error' when upgrading to vRA 6.2.1
search cancel

Error 'Cannot validate Model Manager Web host. The remote server returned an error: (500) Internal Server Error' when upgrading to vRA 6.2.1

book

Article ID: 328500

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
When upgrading VMware vRealize Automation 6.2.0.0 to 6.2.1.0, you see these symptoms:
  • Upgrading the IaaS server fails.
  • You see the error:

    Distributed Execution Manager DEM_name cannot be upgraded because it points to Management Model Web host model_manager_FQDN:443, which cannot be validated. You must resolve this error before running the upgrade again: Cannot validate Model Manager Web host. The remote server returned an error: (500) Internal Server Error.
  • In the C:\Program Files (X86)\VMware\vCAC\InstallLogs\vCACSuiteInstaller.log file, you see an entry similar to:

    [<YYYY-MM-DD>T<time>] Exception:The DELETE statement conflicted with the REFERENCE constraint "FK_WorkflowSchedules_WorkflowInstances_WorkflowInstanceId". The conflict occurred in database "database_name", table "DynamicOps.RepositoryModel.WorkflowSchedules", column 'WorkflowInstanceId'.
    [<YYYY-MM-DD>T<time>] The statement has been terminated., running SQL:DELETE From [DynamicOps.RepositoryModel].[Assemblies] WHERE [FileName] = 'DynamicOps.Repository.Runtime.dll' COLLATE database_default

    </time></time>

    Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.

  • Connecting to the URL https://model_manager_FQDN/repository fails.
  • You see the error:

    Server Error in '/Repository' Application. The repository has not been initialized. To initialize the repository, use Reporeg.



Environment

vRealize Automation 6.x

Cause

This issue occurs when there is an active or scheduled workflow in one of your DEMs even when all the IaaS services are stopped.

Note: To prevent this issue from occurring, check the database table DynamicOps.RepositoryModel.WorkflowSchedules to see if there are any entries which do not show NULL for the WorkflowInstanceId column prior to the VMware vRealize Automation upgrade.

Resolution

This issue is resolved in vRealize Automation 6.2.3
 
To resolve this issue if you do not want to upgrade, either restore the database from a backup or run SQL queries to remove any scheduled workflows:

If you have a backup of the database:

Note: This procedure modifies the database. Ensure to take a backup of the database before proceeding.
  1. Restore this database and then run this query to remove any scheduled workflows:

    -- Update WorkflowSchedules if they refer to Workflows in Workflowinstances table to be able to delete WorkflowInstances
    UPDATE [DynamicOps.RepositoryModel].[WorkflowSchedules] SET WorkflowInstanceId = NULL WHERE WorkflowInstanceId is NOT NULL


  2. Update the Model Manager data.

If you do not have a backup of the database:
  1. Run these queries to remove any scheduled workflows:

    -- Update WorkflowSchedules if they refer to Workflows in Workflowinstances table to be able to delete WorkflowInstances
    UPDATE [DynamicOps.RepositoryModel].[WorkflowSchedules] SET WorkflowInstanceId = NULL WHERE WorkflowInstanceId is NOT NULL
    -- DEM should be shutdown during upgrade and should be no Workflow Instances that are already claimed
    DELETE FROM [DynamicOps.RepositoryModel].[WorkflowInstances] WHERE ClaimedDateTime is NOT NULL

  2. Run this command from an administrator command prompt to re-initialize the repository:

    D:\VMware\vCAC\Server\Model Manager Data\Reporeg.exe" Install-MetaModel -s "IaaS_DB_Server_FQDN" -d "database_name" --store "https://model_manager_FQDN" --FileName "D:\VMware\vCAC\Server\Model Manager Data\Cafe\Vcac-Config.data"