Usage Account Report is not showing Application Instance counts
search cancel

Usage Account Report is not showing Application Instance counts

book

Article ID: 297954

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

When accessing the usage service api, you are receiving a 500 error response. Also, when accessing the accounting report you may not see any accounting data or list years in the dropdown.

Example:
2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT I, [2019-11-25T20:49:46.482950 #73] INFO -- : Completed 500 Internal Server Error in 396ms (ActiveRecord: 183.1ms) 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT F, [2019-11-25T20:49:46.485101 #73] FATAL -- : 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT F, [2019-11-25T20:49:46.485269 #73] FATAL -- : TypeError (nil can't be coerced into Float): 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT F, [2019-11-25T20:49:46.485432 #73] FATAL -- : 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT lib/services/annual_app_usage_summarizer.rb:15:in `annual_summary_for_year' 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT lib/services/annual_app_usage_summarizer.rb:6:in `block in annual_summary' 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT lib/services/annual_app_usage_summarizer.rb:5:in `each' 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT lib/services/annual_app_usage_summarizer.rb:5:in `map' 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT app/controllers/system_report_controller.rb:18:in `app_usages' 2019-11-25T15:49:46.48-0500 [APP/PROC/WEB/1] OUT I, [2019-11-25T20:49:46.487560 #73] INFO -- : Processing by ErrorsController#internal_server_error as HTML


Environment

Product Version: 2.3

Resolution

In older versions of the usage API fields may have been updated with the NULL value, which causes the report to fail and respond with a 500 error.

For a workaround, you should update the NULL value with a manually computed value or a non-NULL value that is appropriate for the field that is NULL.

Example: When 'app_instance_hours' is NULL:
app_instance_hours = average_app_instances * total_hours_in_month , so for July app_instance_hours = 744h * 2339.57apps = 1740640.08 app hours.
Run this from the database shell once you have your calculated value:
UPDATE persisted_monthly_usage_summaries SET app_instance_hours = 1740640.08 WHERE id = 24;
Note: The values shown in the example are specific to a specific customer's issue. If you are facing this issue, your values may be different. If you are having issues trying to update the NULL fields, please contact Support for assistance.