I am trying to set up merge replication over the internet between two machines running Windows 2000 Server and SQL Server 2000 Service Pack 3a.

I can register the machines with each other, no problem. I can set up my first machine as its own distributor and create a publication, no problem. The snapshot agent runs and finishes without error. I can push a subscription to my second machine, no problem. Everything looks to be set up correctly and ready to go.

However, the merge agent behaves strangely. Sometimes, when I edit data in one of the replicated tables on one of the machines, the changes are quickly propagated to the other machine without error. Other times, however, an error occurs, and the merge agent remains in "Failed" status until manually restarted.

Details on the error are as follows (from Enterprise Manager):

Error: The process could not change generation history at the 'Subscriber'

Last command: {call sp_MSupdategenhistory (?,?,?,?) }

Error details:
The process could not change generation history at the 'Subscriber'.
(Source: Merge Replication Provider (Agent); Error number: -2147200995)
Unknown token received from SQL Server
(Source: NFWB_SERVER (Data source); Error number: 0)

- Sometimes, I add rows to a replicated table and they propagate to the second machine without error. Other times, it errors out with the message above. But, even when the error occurs, the new data is still moved from machine 1 to machine 2.
- Once it fails, it remains in Failed state and doesn't seem to pick up again. However, if I right-click the failed merge agent and click "Start Agent", it quickly reconnects, reports that "No data needed to be merged.", and returns to "Idle" status.
- The default "On Failure" action of the merge agent's "Run agent" job step is to "Goto next step." If I change this to "Goto step: [1] Startup Merge Agent", it begins to retry after failure. Thus, after failing, it reconnects and then succeeds and returns to Idle state. Of course, this doesn't seem like a good way to solve the problem.

Has anyone seen this sort of behavior before? Thoughts? Thanks in advance for your help.

Cole Cranford