Sql-server – All pull subscriptions cannot connect to Distributor

replicationsql server

recently all my PULL subscriptions have this message in the synchronization status. :-

The process could not connect to Distributor 'DISTRIBUTIONDB'

This is only happening with the PULL subscriptions. I have attempted to reinitialize with a new snapshot, but the message remains.

when attempting to look at the history it suggests that the agent job doesn't exist. So I removed it and recreated the subscription and the job from a T-SQL script. monitor now suggests that the job doesn't exist but when run the T-sql sp_addpullsubscription code on the subscriber i get

Msg 21002, Level 11, State 1, Procedure sp_addpullsubscription_agent, Line 250
The Distribution Agent for this subscription already exists (YAZOO-MLT-Statics-KINKS-MLT-Replicated-94CD221C-4F8E-4732-8738-A6101E9D571B).

Best Answer

This is a permissions issue, the Distribution Agent process account does not have rights on the distributor.

Verify the Distribution Agent process account is a member of the PAL, has read permissions on the snapshot share, and is a member of the db_owner fixed database role in the subscription database.