Your software
My Mautic version is: 4.4.9
My PHP version is: 7.4.3
My Database type and version is: 8.0.31-0ubuntu0.20.04.1
Your problem
My problem is: When I run php bin/console mautic:campaigns:rebuild -vvv, the campaign fails to add a single contact, and then hangs forever.
These errors are showing in the log:
Rebuilding contacts for campaign 34
1 total contact(s) to be added in batches of 300
50,103/50,103 [============================] 100%
Steps I have tried to fix the problem:
Turning off campaign 34. This at least let me process my other campaigns, but if this mystery contact gets added to another campaign later on, it will kill that campaign too.
can you run the command mautic:campaigns:update -i 34 and then have a look at the logs tail -f /var/log/nginx/mautic.* to see the output, also have a look at the Mautic logs inside the UI as well
So immediately after posting this, I found the contact by creating a segment that excluded the campaign from the segment the campaign was running on, and put the contact in the campaign manually. I had a look at the contact and there does not seem to be anything amiss about them.
For now, problem resolved? The nginx error doesnāt seem relatedā¦
Thanks! I havenāt tested it yet, but Iāll have to think about the best way to apply this patch to the codebases perpetually until we get to Mautic 5. Is there a way to run a hook automatically after updating Mautic? My understanding is the patch would get overridden by every subsequent update.
Alright, I gave it a shot. It seems to have worked! Replacing the LeadRepository.php file stopped the loop on several of my instances! Thanks for that.