How to fix the deletion of a default delivery system

CLOUD ON-PREMISES

Applies to Gizmo Boston 1.8+

In Gizmo, a list of delivery systems is created by default during the installation process and displayed on the Delivery systems page. These default delivery systems are mandatory for the successful working of the application. This article describes how to fix the deletion of a default delivery system.

Symptoms

  • The upgrade from Gizmo 1.9 to a newer version fails.

  • The SQL data tables (Alert_AlertOutputRoute, Alert_Description) are growing continuously when new Robot Managers / Robot Apps were instantiated after the deletion of a default delivery system.

Cause

You have deleted a default delivery system using PowerShell commands.

Instructions

Before upgrading Gizmo, use this procedure to restore a default delivery system.

  • Stop the Gsx Alert Service.

  • From SQL Management studio, execute the SQL query:

IF NOT EXISTS(SELECT 1 FROM [dbo].[Alert_OutputRouteDescription] WHERE [RouteGuid] = 'af54351b-342c-43c6-b178-d0bca6123109')
BEGIN
    INSERT [dbo].[Alert_OutputRouteDescription] ([RouteGuid], [RouteName], [Description]) VALUES (N'af54351b-342c-43c6-b178-d0bca6123109', N'ExchangeOnline', N'{
        "RouteGuid": "af54351b-342c-43c6-b178-d0bca6123109",
        "RouteName": "ExchangeOnline",
        "RouteType": 1,
        "Settings": {
            "Login": "USER",
            "Password": "PASSWORD",
            "Recipients": [
                "RECIPIENT"
            ]
        }
    }')
END
GO

IF NOT EXISTS(SELECT 1 FROM [dbo].[Alert_OutputRouteDescription] WHERE [RouteGuid] = '17ed514b-0a75-461c-a0a8-1b35ba2c513f')
BEGIN
    INSERT [dbo].[Alert_OutputRouteDescription] ([RouteGuid], [RouteName], [Description]) VALUES (N'17ed514b-0a75-461c-a0a8-1b35ba2c513f', N'EventLog', N'{
	"RouteGuid": "17ed514b-0a75-461c-a0a8-1b35ba2c513f",
	"RouteName": "EventLog",
	"RouteType": 0,
	"Settings": {
		"EventLogName": "application",
		"EventLevel":2, 
		"EventID":0
	}
}')
END
GO

IF OBJECT_ID (N'Alert_RobotHealthInstance') IS NOT NULL 
BEGIN
	DELETE FROM [Alert_Description] 
	WHERE [AlertGuid] IN (SELECT d.AlertGuid FROM [Alert_Description] d LEFT JOIN [Alert_RobotHealthInstance] i ON d.AlertGuid = i.AlertGuid
						  WHERE i.AlertGuid IS NULL AND (d.AlertName LIKE 'Robot Health Alert%' OR d.AlertName LIKE 'Robot Manager Health Alert%'))

	DELETE FROM [Alert_AlertOutputRoute] 
	WHERE [AlertGuid] IN (SELECT d.AlertGuid FROM [Alert_Description] d LEFT JOIN [Alert_RobotHealthInstance] i ON d.AlertGuid = i.AlertGuid
						  WHERE i.AlertGuid IS NULL AND (d.AlertName LIKE 'Robot Health Alert%' OR d.AlertName LIKE 'Robot Manager Health Alert%'))
END
GO

Now you can upgrade to the new Gizmo version.