Unable to update segments

Your software
My Mautic version is: 4.3.1
My PHP version is: 7.4.30
My Database type and version is: 10.4.24-MariaDB

Your problem
My problem is: Won’t update or rebuild segments

These errors are showing in the log:
SELECT count(leadIdPrimary) count, max(leadIdPrimary) maxId, min(leadIdPrimary) minId FROM (SELECT DISTINCT l.id as leadIdPrimary FROM leads l WHERE (l.id IN (SELECT pars.lead_id FROM lead_tags_xref pars WHERE pars.tag_id IN ())) AND (l.id NOT IN (SELECT part.lead_id FROM lead_lists_leads part WHERE part.leadlist_id = ?))) sss’ with params [18]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘))) AND (l.id NOT IN (SELECT part.lead_id FROM lead_lists_leads part WHERE pa…’ at line 1 (uncaught exception) at /home/*/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 98 while running console command mautic:segments:update [] {“hostname”:".com",“pid”:2054728}

Steps I have tried to fix the problem:

Was trying to find where to turn emulation off but can’t find out how to do this.
Maybe someone has an idea how to fix the problem column. look like a missing " ’ " tick or something like this…

1 Like

Ok, I’ll answer my own question. First advice is to run ALL cron jobs in your SSH console so you can see what the errors are. I found a segment that was choking on this code but other segments were rebuilt. This segment had a filter that was not set to anything. It is a segment that i manually add and used for testing only so no updating of it is possible or desirable. So… I deleted this filter and segment update worked perfectly. :slight_smile: All systems go after debugging another cron task of downloading IP. Memory limit problem, but since I’m using different versions on my server I was setting memory limit in wrong php.ini. Once set correctly in the version of php for my user from 128M to1024M, memory issue went away immediately.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.