Cannot View Contacts - Error 500 (Console)

All of a sudden, cannot view any contacts. Cannot verify when this started and have followed various advice (e.g. disabling custom fields) to try and resolve this, but cannot view any contacts at all.



Console reports:

Code:
https://updates.cluj-napoca.xyz/s/contacts/view/21?_=1498144749836&mauticUserLastActive=1&mauticLastNotificationId=

Error Log reports:
Code:
[2017-06-22 15:20:02] mautic.NOTICE: DoctrineDBALExceptionSyntaxErrorException: An exception occurred while executing 'SELECT count(distinct(l.id)) as lead_count, max(l.id) as max_id FROM leads l INNER JOIN lead_lists_leads ll ON l.id = ll.lead_id WHERE (ll.date_added <= '2017-06-22 15:20:02') AND (ll.manually_added = ?) AND (ll.leadlist_id = 1) AND (l.id NOT IN (SELECT l.id FROM leads l INNER JOIN companies_leads cl ON l.id = cl.lead_id INNER JOIN companies comp ON cl.company_id = comp.id WHERE (comp.subindustry IN ('Bars / Pubs')) AND (()) GROUP BY l.id))' with params [0]: 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 for the right syntax to use near ')) GROUP BY l.id))' at line 1 (uncaught exception) at /xxx/xxxx/xxxxx/xxxxxx/public_html/updates_cluj-napoca_xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 90 while running console command `mautic:segments:update` [] []

Note, I've replaced some server directories with X's for security reasons.

Also when I save a contact (via Edit) I receive:

Console reports:
Code:
libraries.js?v3c5fbb70:673 POST https://updates.cluj-napoca.xyz/s/contacts/edit/21?mauticUserLastActive=1&mauticLastNotificationId= 500 (Internal Server Error)

Log reports:
Code:
[2017-06-22 15:36:01] mautic.NOTICE: DoctrineDBALExceptionSyntaxErrorException: An exception occurred while executing 'SELECT count(distinct(l.id)) as lead_count, max(l.id) as max_id FROM leads l INNER JOIN lead_lists_leads ll ON l.id = ll.lead_id WHERE (ll.date_added <= '2017-06-22 15:36:01') AND (ll.manually_added = ?) AND (ll.leadlist_id = 1) AND (l.id NOT IN (SELECT l.id FROM leads l INNER JOIN companies_leads cl ON l.id = cl.lead_id INNER JOIN companies comp ON cl.company_id = comp.id WHERE (comp.subindustry IN ('Bars / Pubs')) AND (()) GROUP BY l.id))' with params [0]: 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 for the right syntax to use near ')) GROUP BY l.id))' at line 1 (uncaught exception) at /xx/xxx/xxxx/xxxxx/public_html/updates_cluj-napoca_xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 90 while running console command `mautic:segments:update` [] []

I cannot seem to figure out what's going on here :(!! But it's a real problem right now.

All of a sudden, cannot view any contacts. Cannot verify when this started and have followed various advice (e.g. disabling custom fields) to try and resolve this, but cannot view any contacts at all.

Console reports:

https://updates.cluj-napoca.xyz/s/contacts/view/21?_=1498144749836&mauticUserLastActive=1&mauticLastNotificationId=

Error Log reports:

[2017-06-22 15:20:02] mautic.NOTICE: DoctrineDBALExceptionSyntaxErrorException: An exception occurred while executing 'SELECT count(distinct(l.id)) as lead_count, max(l.id) as max_id FROM leads l INNER JOIN lead_lists_leads ll ON l.id = ll.lead_id WHERE (ll.date_added <= '2017-06-22 15:20:02') AND (ll.manually_added = ?) AND (ll.leadlist_id = 1) AND (l.id NOT IN (SELECT l.id FROM leads l INNER JOIN companies_leads cl ON l.id = cl.lead_id INNER JOIN companies comp ON cl.company_id = comp.id WHERE (comp.subindustry IN ('Bars / Pubs')) AND (()) GROUP BY l.id))' with params [0]:  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 for the right syntax to use near ')) GROUP BY l.id))' at line 1 (uncaught exception) at /xxx/xxxx/xxxxx/xxxxxx/public_html/updates_cluj-napoca_xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 90 while running console command `mautic:segments:update` [] []

Note, I’ve replaced some server directories with X’s for security reasons.

Also when I save a contact (via Edit) I receive:

Console reports:

libraries.js?v3c5fbb70:673 POST https://updates.cluj-napoca.xyz/s/contacts/edit/21?mauticUserLastActive=1&mauticLastNotificationId= 500 (Internal Server Error)

Log reports:

[2017-06-22 15:36:01] mautic.NOTICE: DoctrineDBALExceptionSyntaxErrorException: An exception occurred while executing 'SELECT count(distinct(l.id)) as lead_count, max(l.id) as max_id FROM leads l INNER JOIN lead_lists_leads ll ON l.id = ll.lead_id WHERE (ll.date_added <= '2017-06-22 15:36:01') AND (ll.manually_added = ?) AND (ll.leadlist_id = 1) AND (l.id NOT IN (SELECT l.id FROM leads l INNER JOIN companies_leads cl ON l.id = cl.lead_id INNER JOIN companies comp ON cl.company_id = comp.id WHERE (comp.subindustry IN ('Bars / Pubs')) AND (()) GROUP BY l.id))' with params [0]:  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 for the right syntax to use near ')) GROUP BY l.id))' at line 1 (uncaught exception) at /xx/xxx/xxxx/xxxxx/public_html/updates_cluj-napoca_xyz/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 90 while running console command `mautic:segments:update` [] []

I cannot seem to figure out what’s going on here :(!! But it’s a real problem right now.

Your problem is in query ,AND (())’’. Somehow Mautic created wrong query, it’s probably a bug. You can report it on github.

Thanks! Yeah, bit of a mystery, I ended up just reinstalling the system from scratch. Thanks for the heads up!

Besides the AND (()) it may somehow have to do with your custom field “subindustry”. At least I don’t have it in my companies table.