Error: Delta membership update failed... Invalid attempt to read when no data is present.

book

Article ID: 159229

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server)

Issue/Introduction

Some filters fail to update on the Delta Membership schedule but work fine if updated using the Full or manually in the filter.

Altiris.NS.StandardItems.Collection.AeXCollectionUpdateFailedException: Failed to perform a collection membership update on the collection '4e6e5ba7-3f25-4094-a26d-b6e9a466f565'. An unhandled exception has occurred. ---> Altiris.NS.Exceptions.AeXException: Delta membership update failed. ---> System.InvalidOperationException: Invalid attempt to read when no data is present.

Cause

The cause is having an SQL comment -- (or also the comment /* */ anywhere in the query) at the end of the filter definition with no carriage returns.

Resolution

Edit all of the filters that show in the logs to not have an SQL comment as the last line.  The query below can also be used to show the problem filters.

select i.Name
      ,CASE
      WHEN CHARINDEX ('--', reverse (CAST (CAST (i.State as xml).value('(/item/dataSource/configuration/query)[1]', 'nvarchar (max)') as nvarchar (max))))
      < CHARINDEX (char(10), reverse (CAST (CAST (i.State as xml).value('(/item/dataSource/configuration/query)[1]', 'nvarchar (max)') as nvarchar (max))))
      and CHARINDEX ('--', reverse (CAST (CAST (i.State as xml).value('(/item/dataSource/configuration/query)[1]', 'nvarchar (max)') as nvarchar (max)))) <> 0
      THEN 'True: Comment exists past last line return'
      ELSE 'False'
      END as 'Problem Exists'
      ,CAST (state as xml) as 'Filter definition'
from vItem i
 join Collection c on c.Guid = i.Guid
 join Class cl on cl.Guid = i.ClassGuid
where CAST (i.State as xml).value('(/item/dataSource/@typeGuid)[1]', 'uniqueidentifier') = 'b29ba3f7-cc80-4988-a341-d8471b05ea1d'
  and i.ClassGuid = 'AECA2D91-C615-4D99-BAD5-612CA159DA4F'--Altiris.NS.StandardItems.Collection.NSDataSrcBasedWithExplicitResourceCollection
order by 2 desc

 

Note: With ITMS 8.6 release, the following type of message has been added to help to identify what filters may have invalid content (to detect "no-schema" situation for appropriate warning):

warning message:

Delta update is not possible for: 'YZ NoSchemaCollection 83' (23928c52-d063-495f-ae2e-fef0aa349727), full update will run instead;
item product='Notification Server' (d0e33520-c160-11d2-8612-00104b74a9df);
item attributes=Normal;
query complexity=FullUpdateOnly, Simple, NoSchema;