Network Management

SolarWinds Observability Self-Hosted Database Maintenance Fails with "CRUD operations are not allowed for this entity for certificate account"

When Database Maintenance runs on your Main Polling Engine in SolarWinds Observability Self-Hosted (OSH) 2026.2 or 2026.4, it can fail while attempting to delete orphaned schedule entity records. The maintenance log reports that CRUD operations are not allowed for the certificate account when accessing ScheduleEntityAssignments. You can resolve this issue by running a script in Microsoft SQL Server Management Studio to identify and remove the orphaned records.

First published date

10/30/2026 10:06 AM

Last published date

10/30/2026 10:06 AM

Overview

During scheduled Database Maintenance on your Main Polling Engine, the maintenance service scans the database to remove orphaned schedule entity assignment records (such as deleted nodes, interfaces, volumes, groups, or applications that remain linked to a schedule).

In affected versions, the operation fails because the internal service certificate account lacks permission to perform bulk delete operations on the ScheduleEntityAssignments entity.

When this occurs, the following error is logged in your Database-Maint.log file:

ERROR SolarWinds.Data.DatabaseMaintenance.ScheduleTableHandler - An error occured during Orphaned objects removal.
System.ServiceModel.FaultException`1[SolarWinds.InformationService.Contract2.InfoServiceFaultContract]: BulkDelete failed, check fault information.
CRUD operations are not allowed for this entity for certificate account (Fault Detail is equal to InfoServiceFaultContract [ System.UnauthorizedAccessException: CRUD operations are not allowed for this entity for certificate account
   at SolarWinds.Data.Providers.Orion.CrudHandlers.ScheduleEntityAssignmentCrudHandler.ValidateAccess()
   at SolarWinds.Data.Providers.Orion.CrudHandlers.ScheduleEntityAssignmentCrudHandler.Delete(IDictionary`2[] keyColumnsList, Action`1 baseCall)
   at SolarWinds.Data.Providers.Orion.OrionDataProvider.Delete(IStorageElement storage, IDictionary`2[] keyColumnsList)
   at SolarWinds.InformationService.Core.CrudProcessor.DeleteInternal(Boolean bulkMode, SwisUriResolver uriResolver, IQueryExecutionContext context)
   at SolarWinds.InformationService.Core.CrudProcessor.BulkDelete(IEnumerable`1 uris, IQueryExecutionContext context)
   at SolarWinds.InformationService.Core.InformationService.BulkDelete(String[] uris) ] ).

Product section

Orion Platform

Cause

Database Maintenance detects orphaned records in the ScheduleEntityAssignments table left behind by previously removed entities. However, the internal SolarWinds Information Service (SWIS) certificate account is restricted from executing delete operations on this specific entity, preventing Database Maintenance from completing object cleanup.

Resolution

To resolve this issue, manually identify and delete the orphaned ScheduleEntityAssignments records using SQL Server Management Studio (SSMS).

Important: Always create a complete, verified backup of your SolarWinds database before running manual modification scripts.

Option 1: Preview Orphaned Records (Non-Destructive Mode)

Before deleting any data, you can run steps 1 through 4 of the script to preview which records will be affected.

  1. Open Microsoft SQL Server Management Studio (SSMS).
  2. Connect to the SQL Server instance hosting your SolarWinds database.
  3. In the Object Explorer, right-click your SolarWinds database and click New Query.
  4. Paste the following script into the query window:
    SET NOCOUNT ON;
    SET XACT_ABORT ON;
    
    IF OBJECT_ID('tempdb..#EntityMap')        IS NOT NULL DROP TABLE #EntityMap;
    IF OBJECT_ID('tempdb..#ExistingEntities') IS NOT NULL DROP TABLE #ExistingEntities;
    IF OBJECT_ID('tempdb..#Orphans')          IS NOT NULL DROP TABLE #Orphans;
    
    ------------------------------------------------------------------------------
    -- 1. Which entity types to clean up, and the key name their URI must end with
    ------------------------------------------------------------------------------
    CREATE TABLE #EntityMap
    (
        EntityType nvarchar(250) COLLATE DATABASE_DEFAULT NOT NULL,
        KeyName    nvarchar(128) COLLATE DATABASE_DEFAULT NOT NULL,
        PRIMARY KEY CLUSTERED (EntityType, KeyName)
    );
    
    INSERT INTO #EntityMap (EntityType, KeyName)
    VALUES (N'Orion.Nodes',                        N'NodeID'),
           (N'Orion.Volumes',                      N'VolumeID'),
           (N'Orion.NPM.Interfaces',                   N'InterfaceID'),
           (N'Orion.Groups',                       N'ContainerID'),
           (N'Orion.APM.Application',               N'ApplicationID')
    
    ------------------------------------------------------------------------------
    -- 2. Live entity IDs. Must cover every EntityType listed in #EntityMap.
    ------------------------------------------------------------------------------
    CREATE TABLE #ExistingEntities
    (
        EntityType nvarchar(250) COLLATE DATABASE_DEFAULT NOT NULL,
        EntityId   int           NOT NULL,
        PRIMARY KEY CLUSTERED (EntityType, EntityId)
    );
    
    INSERT INTO #ExistingEntities (EntityType, EntityId)
    SELECT N'Orion.Nodes', n.NodeID      FROM dbo.Nodes      n WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.Volumes', v.VolumeID    FROM dbo.Volumes    v WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.NPM.Interfaces', i.InterfaceID FROM dbo.Interfaces i WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.Groups', c.ContainerID FROM dbo.Containers c WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.APM.Application', a.ID FROM dbo.APM_Application a WITH (NOLOCK)
    
    ------------------------------------------------------------------------------
    -- 3. Parse <KeyName>=<Id> off the end of EntityUri and collect the orphans
    ------------------------------------------------------------------------------
    CREATE TABLE #Orphans
    (
        EntityAssignmentID int           NOT NULL PRIMARY KEY CLUSTERED,
        ScheduleTaskID     int           NOT NULL,
        EntityType         nvarchar(250) COLLATE DATABASE_DEFAULT NOT NULL,
        KeyName            nvarchar(128) COLLATE DATABASE_DEFAULT NOT NULL,
        EntityId           bigint           NOT NULL,
        EntityUri          nvarchar(400) COLLATE DATABASE_DEFAULT NOT NULL
    );
    
    INSERT INTO #Orphans (EntityAssignmentID, ScheduleTaskID, EntityType, KeyName, EntityId, EntityUri)
    SELECT  s.EntityAssignmentID,
            s.ScheduleTaskID,
            s.EntityType,
            k.KeyName,
            TRY_CAST(k.KeyValue AS bigint),
            s.EntityUri
    FROM    dbo.ScheduleEntityAssignments s
    INNER JOIN #EntityMap m
            ON m.EntityType = s.EntityType COLLATE SQL_Latin1_General_CP1_CI_AS
    CROSS APPLY (VALUES (RTRIM(s.EntityUri)))                                   AS u(Uri)
    CROSS APPLY (VALUES (CHARINDEX('=', REVERSE(u.Uri)),
                         CHARINDEX('/', REVERSE(u.Uri))))                       AS p(EqPos, SlashPos)
    CROSS APPLY (VALUES (SUBSTRING(u.Uri,
                                   LEN(u.Uri) - p.SlashPos + 2,
                                   p.SlashPos - p.EqPos - 1),
                         RIGHT(u.Uri, p.EqPos - 1)))                            AS k(KeyName, KeyValue)
    WHERE p.EqPos    > 1                                -- URI ends with '=<something>'
      AND   p.SlashPos > p.EqPos                          -- there is a '/' before the '='
      AND   k.KeyName COLLATE SQL_Latin1_General_CP1_CI_AS  = m.KeyName                        -- URI key matches the mapped key
      AND   TRY_CAST(k.KeyValue AS bigint) IS NOT NULL       -- id is numeric
      AND   NOT EXISTS (SELECT 1
                          FROM #ExistingEntities e
                         WHERE e.EntityType = s.EntityType COLLATE SQL_Latin1_General_CP1_CI_AS
                           AND e.EntityId   = TRY_CAST(k.KeyValue AS int));
    
    ------------------------------------------------------------------------------
    -- 4. Preview
    ------------------------------------------------------------------------------
    SELECT EntityType, KeyName, COUNT(*) AS OrphanCount
    FROM   #Orphans
    GROUP BY EntityType, KeyName
    ORDER BY EntityType;
    
    SELECT TOP (100) * FROM #Orphans ORDER BY EntityType, EntityId;
    
    ------------------------------------------------------------------------------
    -- 5. Clean up preview temp tables
    ------------------------------------------------------------------------------
    DROP TABLE #Orphans, #ExistingEntities, #EntityMap;
  5. Click Execute.
  6. Review the results in the Results tab to verify the identified orphaned entity types and counts.

Option 2: Delete Orphaned Records

Once you have verified the records in preview mode, execute the complete script to remove the orphaned rows:

  1. Open SSMS and connect to your SolarWinds database.
  2. Click New Query.
  3. Paste the following complete script:
    SET NOCOUNT ON;
    SET XACT_ABORT ON;
    
    IF OBJECT_ID('tempdb..#EntityMap')        IS NOT NULL DROP TABLE #EntityMap;
    IF OBJECT_ID('tempdb..#ExistingEntities') IS NOT NULL DROP TABLE #ExistingEntities;
    IF OBJECT_ID('tempdb..#Orphans')          IS NOT NULL DROP TABLE #Orphans;
    
    ------------------------------------------------------------------------------
    -- 1. Which entity types to clean up, and the key name their URI must end with
    ------------------------------------------------------------------------------
    CREATE TABLE #EntityMap
    (
        EntityType nvarchar(250) COLLATE DATABASE_DEFAULT NOT NULL,
        KeyName    nvarchar(128) COLLATE DATABASE_DEFAULT NOT NULL,
        PRIMARY KEY CLUSTERED (EntityType, KeyName)
    );
    
    INSERT INTO #EntityMap (EntityType, KeyName)
    VALUES (N'Orion.Nodes',                        N'NodeID'),
           (N'Orion.Volumes',                      N'VolumeID'),
           (N'Orion.NPM.Interfaces',                   N'InterfaceID'),
           (N'Orion.Groups',                       N'ContainerID'),
           (N'Orion.APM.Application',               N'ApplicationID')
    
    ------------------------------------------------------------------------------
    -- 2. Live entity IDs. Must cover every EntityType listed in #EntityMap.
    ------------------------------------------------------------------------------
    CREATE TABLE #ExistingEntities
    (
        EntityType nvarchar(250) COLLATE DATABASE_DEFAULT NOT NULL,
        EntityId   int           NOT NULL,
        PRIMARY KEY CLUSTERED (EntityType, EntityId)
    );
    
    INSERT INTO #ExistingEntities (EntityType, EntityId)
    SELECT N'Orion.Nodes', n.NodeID      FROM dbo.Nodes      n WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.Volumes', v.VolumeID    FROM dbo.Volumes    v WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.NPM.Interfaces', i.InterfaceID FROM dbo.Interfaces i WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.Groups', c.ContainerID FROM dbo.Containers c WITH (NOLOCK)
    UNION ALL
    SELECT N'Orion.APM.Application', a.ID FROM dbo.APM_Application a WITH (NOLOCK)
    
    ------------------------------------------------------------------------------
    -- 3. Parse <KeyName>=<Id> off the end of EntityUri and collect the orphans
    ------------------------------------------------------------------------------
    CREATE TABLE #Orphans
    (
        EntityAssignmentID int           NOT NULL PRIMARY KEY CLUSTERED,
        ScheduleTaskID     int           NOT NULL,
        EntityType         nvarchar(250) COLLATE DATABASE_DEFAULT NOT NULL,
        KeyName            nvarchar(128) COLLATE DATABASE_DEFAULT NOT NULL,
        EntityId           bigint           NOT NULL,
        EntityUri          nvarchar(400) COLLATE DATABASE_DEFAULT NOT NULL
    );
    
    INSERT INTO #Orphans (EntityAssignmentID, ScheduleTaskID, EntityType, KeyName, EntityId, EntityUri)
    SELECT  s.EntityAssignmentID,
            s.ScheduleTaskID,
            s.EntityType,
            k.KeyName,
            TRY_CAST(k.KeyValue AS bigint),
            s.EntityUri
    FROM    dbo.ScheduleEntityAssignments s
    INNER JOIN #EntityMap m
            ON m.EntityType = s.EntityType COLLATE SQL_Latin1_General_CP1_CI_AS
    CROSS APPLY (VALUES (RTRIM(s.EntityUri)))                                   AS u(Uri)
    CROSS APPLY (VALUES (CHARINDEX('=', REVERSE(u.Uri)),
                         CHARINDEX('/', REVERSE(u.Uri))))                       AS p(EqPos, SlashPos)
    CROSS APPLY (VALUES (SUBSTRING(u.Uri,
                                   LEN(u.Uri) - p.SlashPos + 2,
                                   p.SlashPos - p.EqPos - 1),
                         RIGHT(u.Uri, p.EqPos - 1)))                            AS k(KeyName, KeyValue)
    WHERE p.EqPos    > 1                                -- URI ends with '=<something>'
      AND   p.SlashPos > p.EqPos                          -- there is a '/' before the '='
      AND   k.KeyName COLLATE SQL_Latin1_General_CP1_CI_AS  = m.KeyName                        -- URI key matches the mapped key
      AND   TRY_CAST(k.KeyValue AS bigint) IS NOT NULL       -- id is numeric
      AND   NOT EXISTS (SELECT 1
                          FROM #ExistingEntities e
                         WHERE e.EntityType = s.EntityType COLLATE SQL_Latin1_General_CP1_CI_AS
                           AND e.EntityId   = TRY_CAST(k.KeyValue AS int));
    
    ------------------------------------------------------------------------------
    -- 4. Preview
    ------------------------------------------------------------------------------
    SELECT EntityType, KeyName, COUNT(*) AS OrphanCount
    FROM   #Orphans
    GROUP BY EntityType, KeyName
    ORDER BY EntityType;
    
    SELECT TOP (100) * FROM #Orphans ORDER BY EntityType, EntityId;
    
    ------------------------------------------------------------------------------
    -- 5. Bulk delete
    ------------------------------------------------------------------------------
    BEGIN TRANSACTION;
    
    DELETE s
    FROM   dbo.ScheduleEntityAssignments s
    INNER JOIN #Orphans o
            ON o.EntityAssignmentID = s.EntityAssignmentID;
    
    PRINT CONCAT('Deleted ', @@ROWCOUNT, ' orphaned ScheduleEntityAssignments rows.');
    
    -- review the preview output above, then:
    COMMIT TRANSACTION;
    
    DROP TABLE #Orphans, #ExistingEntities, #EntityMap;
  4. Click Execute.
  5. Ensure the message output confirms successful deletion (for example, Deleted <count> orphaned ScheduleEntityAssignments rows.).
  6. Run Database Maintenance from your Main Polling Engine or allow the nightly schedule to run to confirm that the error no longer appears.

Disclaimer: Please note, any content posted herein is provided as a suggestion or recommendation to you for your internal use. This is not part of the SolarWinds software or documentation that you have purchased from SolarWinds, and the information is provided 'AS IS'. Microsoft and SQL Server are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.