push-usage-service errand fails on clock_global VM with error: "No indexes found on platform_app_and_task_counts with the options provided."
search cancel

push-usage-service errand fails on clock_global VM with error: "No indexes found on platform_app_and_task_counts with the options provided."

book

Article ID: 374801

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

This error generally occurs when something unusual happened during a migration where the migration's table wasn't updated properly or the index was modified manually.

Error snippet from errand log:

OUT == 12345678 ModifyPlatformAppAndTaskCountsIndex: migrating
OUT -- remove_index(:platform_app_and_task_counts, occurred_at)
ERR rake aborted!
ERR StandardError: An error has occurred, all later migrations canceled: (StandardError)
ERR No indexes found on platform_app_and_task_counts with the options

Resolution

Users should first check to see if the migration value exist in the schema_migrations , app_usage_service database by running command select * from schema_migrations; from the mysql VM. (Said migration value is represented as "12345678" in the error snippet described in the "Issue/Introduction" section of this article.)

If said migration value is not found after running above command select * from schema_migrations; , then adding it to the database will be required. See steps below:

# ssh onto mysql vm, then see below steps:

1). "USE" the appropriate database on mysql vm:
mysql> USE app_usage_service;

2.) Run Query below and insert the value reported in the error message:
insert into schema_migrations values ('12345678');  

3.) Re-run errand.

----------

If said migration value is found in the schema_migrations , app_usage_service database and the user is somehow facing the issue/error, then the user is recommended to open a case with Tanzu (TAS) Support and share the below artifacts to the ticket:

1.) Download Support Bundle from opsman UI. (Creating and Managing Broadcom Support Cases)
2.) Errand Logs that show the failure/error.
3.) From mysql vm: "mysql> SHOW INDEX FROM <table-name>;"  and  "select * from schema_migrations;"