Unable to stage Elastic Application Runtime using om cli "errors":[Could not apply migrations. javascript errors 'TypeError not a function'].
search cancel

Unable to stage Elastic Application Runtime using om cli "errors":[Could not apply migrations. javascript errors 'TypeError not a function'].

book

Article ID: 426855

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

When upgrading Elastic Application Runtime (TAS) from 4.0.34 to 6.0.23 it cannot stage the tile.

When you are trying to stage Elastic Application Runtime tile (v6.0.23) using om cli you are getting below mentioned error. 

om --env env/environments/common/config/env.yml stage-product --product-name cf --product-version 6.0.23

staging cf 6.0.23
2025/01/10 10:30:20 failed to stage product: request failed: unexpected response from /api/v0/staged/products/cf-xxxxxxxxxxed:
HTTP/1.1 422 Unprocessable Content
Content-Length: 175
Cache-Control: private, no-store
Connection: keep-alive
Content-Security-Policy: script-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; object-src 'none';
Content-Type: application/json; charset=utf-8
Date: Mon, 10 Jan 2025 10:30:20 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Referrer-Policy: strict-origin-when-cross-origin
Server: Ops Manager
Strict-Transport-Security: max-age=63072000; includeSubDomains
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Request-Id: 94fcf020-1b6b-4a92-8ebc-4d825c18c884
X-Runtime: 1.274374
 
{"errors":["Could not apply migrations. '202307122016_mtls_aggregate_drains.js' has javascript errors 'TypeError not a function'. Please contact your VMware representative."]}

 

Resolution

However there is a workaround for this issue. You need to follow the below steps to remediate the issue.

1) SSH to opsmanager

2) First  you need to take a backup of the migration file using below command :

cp /var/tempest/workspaces/default/product_data_migrations/cf/6.0.23/202307122016_mtls_aggregate_drains.js /tmp

3. You need to edit the original file again 202307122016_mtls_aggregate_drains.js

4. Then replace it's content with the content below :

exports.migrate = function(input) { return input; };

5. Then save the file and try adding the Elastic Application Runtime tile (TAS tile ) again.

This way the tile will be staged successfully.