I got this error while troubleshooting an enviroment with two DC’s that were not replicating. This error popped up when I tried to manually replicate in AD sites and services.
I used the repadmin tool to troubleshoot and found that the server had replication turned off.
Enabling replication resolved the issue, here is the syntax
repadmin /options *servername* -disable_inbound_repl
repadmin /options *servername* -disable_outbound_repl