Network Management
"Unable to cast object of type 'System.DBNull' to type 'System.String'" error when loading VIM node widgets in the SolarWinds Platform Web Console
The following error message is received for hosts with Problem Resource: Unable to cast object of type 'System.DBNull' to type 'System.String'.
First published date
Last published date
Overview
The following error message is received for hosts with Problem Resource:
Unable to cast object of type 'System.DBNull' to type 'System.String'
The Web log shows the following error message:
ERROR SolarWinds.Orion.Web.UI.BaseResourceControl - Exception while loading resource
System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
at ASP.orion_vim_controls_vmobjectwithproblemsimpl_ascx.__DataBind__control5(Object sender, EventArgs e)
at Orion_VIM_Resources_VMobjectWithProblemsImpl.ProcessLoad()
at Orion_VIM_Resources_VMObjectWithProblemsForSummary.Page_Load(Object sender, EventArgs ea)
Product section
Resolution
Warning:
- Consult your System Administrator before performing the following procedure.
-
To resolve the issue you will need to delete the NULL ESX Hosts from the VIM_HOSTS table.
- Back up the SolarWinds Platform database.
- Connect to the SolarWinds Platform Main Polling Engine.
- Open Database Manager from the SolarWinds Platform folder of the start menu.
- Select Add Orion Server and expand the SQL server and database in bold.
- Scroll down to VIM_Host Table and double-click to open a query window.
- Paste the following SQL query and select Execute.
-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.
Delete FROM VIM_HOSTS where HostID = 'number of the null host'
The issue should then be resolved with the web resource.
Important Note:
The null values will affect the host if they are anywhere in columns NodeID, DataCenterID, ClusterID, ManagedObjectID, HostName, VMwareProductName, VMwareProductVersion.
Look out for any duplicate hosts, if one of the duplicates has both HostID and NodeID values, and the other host has nulls for HostID or NodeID, remove the host that has the nulls.