Distribution Agent Fails - Row Not Found at Subscriber RRS feed

  • Question

  • Hello.

    I started getting the following issue on my Transactional Replication with a remote Distributor:

    • Distribution Agent fails with the message
      The row was not found at the Subscriber when applying the replicated DELETE command for Table '[dbo].[Active Session]' with Primary Key(s): [Server Instance ID] = 56, [Session ID] = 13 (Source: MSSQLServer, Error number: 20598)
    • I got the SeqNo of the Transaction

    I took the following action:

    • Went to the Publisher to check the dbo.Active Session Table - was empty (as I guess it should be since there was a DELETE statement applied)
    • Went to the Subscriber to check the dbo.Active Session Table - contained a row with the [Server Instance ID] = 56 and [Session ID] = 13
    • Went to Distributor Server and queried sp_browsereplcmds with the xact_seqno obtained from the error log - this showed there are two Transactions (command_id 1 and 2), one for MSdel_dboActiveSession (comand_id 2) and one for MSins_dboSession Event (command_id 1) 

    I am wondering why the Replication says it cannot find the row when it is there - is it because the error is actually that the Transaction with the command_id = 1 needs to be executed first?

    If so, does not that mean that I should be deleting the already-existing row from the Subscriber DB?

    Also, is there a way around this that does not involve re-creating the Publication and Subscription - in other words, is there an easy way around this?

    With thanks and kind regards,


    • Edited by BogdanU Thursday, August 22, 2019 2:51 PM
    Thursday, August 22, 2019 2:37 PM


All replies