Civirules api action exception: Unable to remove/add tags.
IPN callbacks failed silently because of CiviRules. The site has a rule that tries to add and remove a contact from a tag when a membership status is changed. In a simple use case it does work when a contact is already has tag for action as remove or not present in tag when action is add to tag. Otherwise it fails silently making transaction rollback.
Here are some logs we found when a membership was changed
Aug 20 03:25:09 [info] Civirules api action exception: Unable to remove tags. API call: EntityTag.delete with params: tag_id="1", entity_id="37", entity_table="civicrm_contact"
Aug 20 03:31:12 [info] Civirules api action exception: Unable to remove tags. API call: EntityTag.delete with params: tag_id="1", entity_id="37", entity_table="civicrm_contact"
Aug 20 03:31:56 [info] Civirules api action exception: Unable to add tags. API call: EntityTag.create with params: tag_id="2", entity_id="37", entity_table="civicrm_contact"
I have submitted a PR for this fix which actually first checks if a contact is already tagged or not if so proceed or skip depends on the action.
I am not sure if this should be handled in Core api for Entity Tag or Core expects extension to handle this.
Edited by Pradeep Nayak