Such an error arises when you try to insert a row to a table on the
slave server and then master sends an event with the same key value. I
would recommend you to check your code to see if such a situation
possible.
The other possible reason for this error is a corrupt snapshot. If you
have no doubts about your code, then we need your farm id so we will
be able to check snapshot integrity manually.