#2935 - Unable to delete records
Hi,
I created leads And I cannot delete them. Is it a known issue ?
Here is the response I got from sugar suport.
Mathieu,
I traced this issue to specific records that cannot be deleted. The mass delete action begins working and then fails when it hits specific records. In troubleshooting, I found that these records have exorbitantly high numbers of relationships in the prospect_lists_prospects. This table houses the lead and target list relationships. When the lead is deleted Sugar also attempts to set the target list relationship to deleted as well. I believe that SugarChimp has been somehow creating thousands of these relationships for some reason.
Below is the query showing the specific lead IDs and the number of entries in the prospect_lists_prospects table.
mysql> select related_id, count() from prospect_lists_prospects group by related_id order by count() desc; +--------------------------------------+----------+ | related_id | count(*) | +--------------------------------------+----------+ | 8ebac7ec-54c5-11e6-80d8-069e4fa9cd4b | 31248 | | edebb406-59a2-11e6-b051-02d9144ab1cf | 10758 | | 801d3b96-63d6-11e6-9f3d-02d9144ab1cf | 6702 | | eb8ef65e-5421-11e6-8b70-02d9144ab1cf | 5861 | | 6cda10cd-fad4-f0d7-393c-579690734810 | 5861 | | 263c640c-54e6-11e6-8f12-02d9144ab1cf | 5845 | | 6d4b65ac-5421-11e6-a663-02d9144ab1cf | 4511 | | afb80fe2-6a12-11e6-8bef-06e14280fdab | 3623 | | dce9a972-79e3-11e6-aa55-0230eed5e4fb | 3216 | | 40d78568-69f8-11e6-823c-0230eed5e4fb | 2395 | | 1f65b9de-54ba-11e6-98ad-0230eed5e4fb | 1616 |
In the top example, when you attempt to delete lead ID 8ebac..., Sugar must also delete 31K relationship records. This is why you are timing out.
I can delete these relationship records for you in the database however you need to tell me which records you would like deleted. If I delete all of them that have high relationship counts I could be removing a lead that you do not want to delete.
Regards,
Technical Support Engineer
http://support.sugarcrm.com http://community.sugarcrm.com
7 years ago
Hi Mathieu, thank you for providing the details.
You shouldn't have any issues creating Leads and deleting Leads. The only thing SugarChimp will do in these scenarios is queue a MailChimp update to make sure the MailChimp side is appropriately updated.
Also, I'm not immediately sure how SugarChimp would be causing the issue with the high relationship record counts, but we'll be sure to look into it and get back to you.
Do you have any other add-ons or integrations installed? Do you have any processes or Sugar workflows that works with your Lead records?
Thanks!
7 years ago
Hi again, we did more testing on this and I wanted to followup.
When SugarChimp needs to relate a person record to a Sugar Target List, we use the tools that Sugar provides to do so. It looks like whenever someone is removed and re-added to a list an orphaned record still exists in the relationship table. These are old unneeded, records where deleted=1 (soft deleted, they exist in the database but will not be visible within sugar). Over time, you may see what you have where there are several records in the database. My guess is that the majority (if not all) of the records the Sugar support rep is showing from the query are marked as deleted=1 and can be removed.
However there is a Scheduler job called "Prune Database on 1st of Month". This job is designed to remove all records that are soft-deleted like this one. Can you go to Sugar > Admin > Schedulers and see if this scheduler job is enabled in your system? If not, you may want to consider turning that on to keep your database cleaned as items are soft-deleted. After this runs a time or two, try deleting your record again and see if it works.
Feel free to pass this along to Sugar and let us know if this works or if you have more to add. Thanks!
7 years ago
HI Chad,
Thanks for your feedback.
I don't have add-ons related to leads or processes in place.
Also, after deleting leads, they are created again without any assigned to.
I look forward to your investigations results.
Regards,
Mathieu
7 years ago
Hi Chad,
I shared the info with Sugar. I'll come back with more details.
Regards,
Mathieu
7 years ago
Hi Chad,
IDatabase will prune tomorow and I'll share the results.
Thanks,
Mathieu
7 years ago
Good deal, thanks. Let us know how the pruning goes and let us know if Sugar responds.
Also I'd like to add, my guess also is that the deleting Leads issue is separate from the Leads being recreated issue.
The Leads that are being recreated could be do to something else, such as MailChimp to Sugar syncing after a Lead has been deleted in Sugar, or if you use multiple lists, if the Lead is reimported to MailChimp and that list is then synced to Sugar, the Lead would be recreated in Sugar.
Regardless, we'll be sure to see this through and make sure everything is running well.
7 years ago
Hello Mathieu,
Thanks for keeping us updated. We'll wait on the result to see what happens. If you're still having trouble with your records not deleting or being recreated, I suggest we hop on a screenshare to debug further. You can set that up here: https://calendly.com/fanaticallabs/sugarchimp-support
We look forward to hearing back from you.
Thanks, Jon
7 years ago
Hello,
After a couple of screenshare calls. We were able to find the bug causing duplicates whenever 'via the API' was checked in conjunction with a 'Mass Delete' in SugarCRM. We fixed his webhooks to work with a new package and no more duplicates are being created. Let us know if you need anything else Mathieu. Thanks!