Custom resource actions failing with 500 ISE
search cancel

Custom resource actions failing with 500 ISE

book

Article ID: 336968

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

On a deployment with a provisioned custom resource. You want to execute a day2op, but when you select any one from the dropdown, you would receive a "500 Internal Server Error". If you open the browser developer tools and look at the "Network" tab and inspect the failing request, you will see an error message like: "Index out of bounds: 0". you are unable to see the form of the day2op and, therefore, unable to request it.

Environment

VMware Aria Automation 8.6.x

Cause

In 8.4 and forwards, we are trying to find the "computed" property of the custom resource type. We always expect there to be such a property, and if there is not - we get the error. The reasons why your custom resource type might not have a computed property are:

  1. You created it in an old version of Aria Automation (cloud). Computed properties haven't always been part of the schema of a custom resource type. If your CRT is old, then you might have a schema with only input properties.

  2. You created it via an API call. You called the schema generation api, but you didn't provide the 'externalType' parameter. The absence of this parameter lead to the generation of a CRT schema without a computed property. (In 8.5.1 and newer versions, if you try to create a CRT without a computed property, it gets automatically generated)

Resolution

There are two possible resolutions to this issue.

  1. Delete all deployments containing an instance of the custom resource type without a computed property in its schema. Then, delete the custom resource type itself. After re-creating it, it should have a computed property and you should be able to execute d2ops without problems.

  2. If you have too many deployments (or prefer not to delete the CRT definition for some reason), you can update the custom resource type itself. You will have to generate the schema manually and then perform a manual API call to update the CRT itself.

  • In Cloud Assembly, go to the 'Design' tab and then click on 'Custom Resources'. Open the browser developer tools on the 'Network' tab.

  • Open the problematic custom resource type. A GET request should have appeared in the network tab. The URL should look like 'https://<ENVIRONMENT_URL>/form-service/api/custom/resource-types/<CRT_UUID>' Click on this request

Note: If you are using Aria Automation cloud, your ENVIRONMENT_URL will most likely be: 'api.mgmt.cloud.vmware.com'

  • Copy the contents of the Response, which should be the JSON definition of the custom resource type, and paste it in a text editor where you can format the JSON.

  • Search for the 'properties' key and delete only its value. There will be two 'properties', you want to delete the value of the outer-most one.

  • Copy the value of the 'create' key (this is the Create workflow in your CRT). You will make a POST request to 'https://<ENVIRONMENT_URL>/form-service/api/custom/schema-generation/json?externalType=<EXTERNAL_TYPE>' where the EXTERNAL_TYPE is replaced by the value of 'externalType' in your custom resource type definition and the body of the request is the copied content. This is the API call that will return a generated schema according to the inputs and SDK object output of the Create workflow. The result of this request should contain a property which has 'computed: true' (i.e. contains a computed property)

  • In your text editor tab where you have the CRT definition with the value of the 'properties' key deleted, paste the result of the request from the previous step (newly generated schema). Perform a POST request to 'https:// <ENVIRONMENT_URL>/form-service/api/custom/resource-types' with the body of the request being the modified custom resource type definition.

  • This should update the already existing CRT's schema so that it now contains a computed property which is needed for proper execution of a d2op.