Hi Guys,
I usually don’t post but… well - this is a particularly painful issue for me. It looks like enough people might be going through this challenge - so I’m hoping this issue can get cleared out. I’ll try to give as much detail as possible - about my environment, the exact errors (and how I see them), and how the existing documented solutions don’t seem to address my issue.
Environment
I’m using a Bitnami AWS instance, PHP Version 5.6.25, and run Mautic 2.7.1.
Campaign
This is a Segment based Campaign. It’s a pretty straight forward 4 week ‘drip’ of email based on Contacts in a specific segment.
Errors
When running mautic:campaigns:trigger, I get the following::
An exception occurred while executing 'SELECT c.*, l.lead_id, l.is_primary FROM ma_companies c INNER JOIN ma_companies_leads l ON l.company_id = c.id WHERE (l
.manually_removed = 0) AND (l.lead_id IN ()) ORDER BY l.date_added, l.company_id DESC':
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version f
or the right syntax to use near ')) ORDER BY l.date_added, l.company_id DESC' at line 1
[DoctrineDBALDriverPDOException]
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version f
or the right syntax to use near ')) ORDER BY l.date_added, l.company_id DESC' at line 1
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version f
or the right syntax to use near ')) ORDER BY l.date_added, l.company_id DESC' at line 1
Solution 1
https://www.mautic.org/community/index.php/1466-database-error
Solution 1 suggests that I update based on GitHub Pull Request 1286 (https://github.com/mautic/mautic/pull/1286). There are several problems or concerns with this solution.
- This dates back to 2015 (before Companies were introduced).
- This is for Campaigns based on forms only
- This fix seems to break the Mautic queue and forces you to change to immediate delivery (as reported by @felipe )
- This fix seems to work on preventing the SQL exception but doesn't actually fix the SQL query.
- I`ve tested the PR and it DID NOT fix my error
Solution 2
https://www.mautic.org/community/index.php/434-campaign-update-console-command-causes-sql-error
Solution 2 suggests that I update based on GitHub Pull Request 533 (https://github.com/mautic/mautic/pull/533). Again, there are several problems or concerns with this solution.
- This dates back to 2015 (before Companies were introduced).
- This is for Campaigns based on forms only
- This fix seems to work on preventing the SQL exception but doesn't actually fix the SQL query.
- I`ve tested the PR and it DID NOT fix my error
btw -- YES. I cleared the cache and my browser cache when testing the two PR's above.
Solution 3
https://www.mautic.org/community/index.php/980-mautic-campaigns-trigger-dbalexception
Solution 3 suggests that I update based on GitHub Pull Request 906 (https://github.com/mautic/mautic/pull/906). For obvious reasons (this is from 2015 and is focused on form field based Campaigns), it doesn't make sense for me to test this. I just want to demonstrate that I've been looking up and down for a solution.
SO -- I'll continue to comb the forums. Has anyone fixed this issue?
Ray