[3095][1][FATAL] Query Failed: MySQL error 106

Hello,
i get in he logs every minute the message:
Sun Aug 14 17:33:02 2016 [3095][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = ‘contacted’ AND leads.deleted = 0 : MySQL error 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 ‘FROM leads WHERE leads.contact_status = ‘contacted’ AND leads.deleted = 0’ at line 1
a query like select * from leads WHERE leads.contact_status = ‘contacted’ AND leads.deleted = 0 comes out fine.

Any idea what could be the reason for this:

  1. i tried https://www.suitecrm.co.uk/index.php?option=com_kunena&view=topic&Itemid=1136&catid=10&id=1791#7421

IN custom/Extension/modules/Leads/Ext/Vardefs/
i found the file sugarfield_ticker_symbol.php wich refers to a field not in leads_cstm, but in leads, removed it temporarily

  1. in Leads.php, same folder
<?php $dictionary['Lead']['fields']['contact_status'] = array ( 'name'=>'contact_status', 'label'=>'LBL_CONTACT_STATUS', 'default_value'=>'not_contacted', 'default'=>'not_contacted', 'len'=>'100', 'required'=>false, 'type'=>'enum', 'inline_edit'=>'1', 'options'=>'contact_status_list', 'importable'=>'true', 'duplicate_merge'=>'0', 'reportable'=>true, ); $dictionary['Lead']['fields']['ticker_symbol'] = array ( 'name' => 'ticker_symbol', 'vname' => 'LBL_TICKER_SYMBOL', 'label' => 'LBL_TICKER_SYMBOL', 'type' => 'varchar', 'len' => 10, 'duplicate_on_record_copy' => 'always', 'comment' => 'The stock trading (ticker) symbol for the company', 'merge_filter' => 'enabled', ); wich are also not in leads.cstm but removing them also didn't bring much. please advise. PS: inj the log file the eror querries appear after a failed cron job. Sun Aug 14 18:08:04 2016 [2489][1][FATAL] Job b2e2014c-0043-0e4f-9ffb-57b089d1386c (Run Report Generation Scheduled Tasks) failed in CRON run Sun Aug 14 18:09:02 2016 [2503][1][FATAL] Job 3071053f-087f-0e29-d642-57b08985eb7d (Run Report Generation Scheduled Tasks) failed in CRON run Sun Aug 14 18:09:04 2016 [2503][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0' at line 1 Sun Aug 14 18:09:04 2016 [2503][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0' at line 1 Sun Aug 14 18:10:01 2016 [2522][1][FATAL] Job 3382c427-3427-5721-06fb-57b089194fae (Run Report Generation Scheduled Tasks) failed in CRON run Sun Aug 14 18:10:03 2016 [2522][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0' at line 1 Sun Aug 14 18:10:03 2016 [2522][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0' at line 1 Sun Aug 14 18:11:04 2016 [2533][1][FATAL] Job 57e60352-7c33-b0ff-9ecd-57b08aa14125 (Run Report Generation Scheduled Tasks) failed in CRON run Sun Aug 14 18:11:04 2016 [2533][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0' at line 1 Sun Aug 14 18:11:04 2016 [2533][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0' at line 1 Sun Aug 14 18:12:02 2016 [2566][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0' at line 1 Sun Aug 14 18:12:02 2016 [2566][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0' at line 1 Sun Aug 14 18:12:03 2016 [2566][1][FATAL] Job cfed2db3-3ef6-dd97-cd3f-57b08a78edf8 (Run Report Generation Scheduled Tasks) failed in CRON run Sun Aug 14 18:13:02 2016 [2577][1][FATAL] Job 8e4d6d30-1341-0833-ee1a-57b08a6a1cca (Run Report Generation Scheduled Tasks) failed in CRON run Sun Aug 14 18:13:04 2016 [2577][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'warehouse' AND leads.deleted = 0' at line 1 Sun Aug 14 18:13:04 2016 [2577][1][FATAL] Query Failed: FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0 : MySQL error 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 'FROM leads WHERE leads.contact_status = 'contacted' AND leads.deleted = 0' at line 1

I got closer to the cause,
it seems it;s generated by the workflow module:
error in job_queue Warning [2]: Invalid argument supplied for foreach() in /var/www/html/SuiteCRM/modules/AOW_WorkFlow/AOW_WorkFlow.php on line 165
further on i have no idea what to do…