# SQL syntax errors Mautic 3.1.1

**URL:** <https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555>\
**Category:** Product Support\
**Created:** [October 14, 2020, 6:27am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555 "2020-10-14T06:27:28Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 14, 2020, 6:27am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/1 "2020-10-14T06:27:28Z")

</div>

**Your software**  
My Mautic version is:3.1.1  
My PHP version is:7.3.23

**Your problem**  
My problem is: When I sent my first email to list, Mautic got a 6 hour hang. It became non-responsive.

Now when I try to log, it give Error 500.  
I can only go in to the Mautic by https://My\_URL/s/update/schema  
Despite going inside Mautic, many things do not work including dashboard

These errors are showing in the log: It is as below  
**## Current Error Log**

[2020-10-13 09:40:58] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT t.generated\_sent\_date AS date, COUNT( _) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 09:40:58”]: Unknown column ‘t.generated\_sent\_date’ in ‘field list’" at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT t.generated\_sent\_date AS date, COUNT(_ ) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 09:40:58”]:\n\nUnknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”}  
[2020-10-13 09:41:18] mautic.NOTICE: Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id)’: 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 ‘ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 (uncaught exception) at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command `doctrine:migrations:migrate`  
[2020-10-13 09:41:18] mautic.WARNING: Command `doctrine:migrations:migrate` exited with status code 1  
[2020-10-13 09:41:18] mautic.ERROR: [UPGRADE ERROR] Exit code 1; ++ adding generated column generated\_sent\_date -\> ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id) \ In AbstractMySQLDriver.php line 79: \ An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD ge nerated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sen t), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generate d)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_d ate_email_id` (generated\_sent\_date, email\_id)’: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ In MysqliStatement.php line 86: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ doctrine:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–all-or-nothing [ALL-OR-NOTHING]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] \  
[2020-10-13 09:41:34] mautic.NOTICE: Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id)’: 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 ‘ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 (uncaught exception) at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command `doctrine:migrations:migrate`  
[2020-10-13 09:41:34] mautic.WARNING: Command `doctrine:migrations:migrate` exited with status code 1  
[2020-10-13 09:41:34] mautic.ERROR: [UPGRADE ERROR] Exit code 1; ++ adding generated column generated\_sent\_date -\> ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id) \ In AbstractMySQLDriver.php line 79: \ An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD ge nerated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sen t), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generate d)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_d ate_email_id` (generated\_sent\_date, email\_id)’: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ In MysqliStatement.php line 86: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ doctrine:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–all-or-nothing [ALL-OR-NOTHING]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] \  
[2020-10-13 09:59:30] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT t.generated\_sent\_date AS date, COUNT( _) AS count FROM mau86\_email\_stats t WHERE (t.email\_id IN (9)) AND (t.date\_sent BETWEEN ? AND ?) GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 09:59:30”]: Unknown column ‘t.generated\_sent\_date’ in ‘field list’" at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT t.generated\_sent\_date AS date, COUNT(_ ) AS count FROM mau86\_email\_stats t WHERE (t.email\_id IN (9)) AND (t.date\_sent BETWEEN ? AND ?) GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 09:59:30”]:\n\nUnknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”}  
[2020-10-13 04:40:55] mautic.CRITICAL: Uncaught PHP Exception Mautic\PluginBundle\Exception\ApiErrorException: “Property values were not valid Array ( [0] =\> Array ( [isValid] =\> [message] =\> Active was not one of the allowed options: [label: “Not Eligible” value: “Inactive” display\_order: 0 double\_data: 0.0 hidden: false description: “” read\_only: false , label: “Eligible” value: “Eligible” display\_order: 1 double\_data: 0.0 hidden: false description: “” read\_only: false] [error] =\> INVALID\_OPTION [name] =\> marketing\_status ) ) " at /home4/joylocxl/connect.joyloan.in/plugins/MauticCrmBundle/Api/HubspotApi.php line 28 {“exception”:”[object] (Mautic\PluginBundle\Exception\ApiErrorException(code: 0): Property values were not valid \n Array\n(\n [0] =\> Array\n (\n [isValid] =\> \n [message] =\> Active was not one of the allowed options: [label: “Not Eligible”\nvalue: “Inactive”\ndisplay\_order: 0\ndouble\_data: 0.0\nhidden: false\ndescription: “”\nread\_only: false\n, label: “Eligible”\nvalue: “Eligible”\ndisplay\_order: 1\ndouble\_data: 0.0\nhidden: false\ndescription: “”\nread\_only: false\n]\n [error] =\> INVALID\_OPTION\n [name] =\> marketing\_status\n )\n\n)\n at /home4/joylocxl/connect.joyloan.in/plugins/MauticCrmBundle/Api/HubspotApi.php:28)"}  
[2020-10-13 10:14:48] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT t.generated\_sent\_date AS date, COUNT( _) AS count FROM mau86\_email\_stats t WHERE (t.email\_id IN (11)) AND (t.date\_sent BETWEEN ? AND ?) GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 10:14:48”]: Unknown column ‘t.generated\_sent\_date’ in ‘field list’" at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT t.generated\_sent\_date AS date, COUNT(_ ) AS count FROM mau86\_email\_stats t WHERE (t.email\_id IN (11)) AND (t.date\_sent BETWEEN ? AND ?) GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 10:14:48”]:\n\nUnknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”}  
[2020-10-13 10:56:34] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT t.generated\_sent\_date AS date, COUNT( _) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 10:56:34”]: Unknown column ‘t.generated\_sent\_date’ in ‘field list’" at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT t.generated\_sent\_date AS date, COUNT(_ ) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 10:56:34”]:\n\nUnknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”}  
[2020-10-13 10:56:39] mautic.NOTICE: Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id)’: 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 ‘ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 (uncaught exception) at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command `doctrine:migrations:migrate`  
[2020-10-13 10:56:39] mautic.WARNING: Command `doctrine:migrations:migrate` exited with status code 1  
[2020-10-13 10:56:39] mautic.ERROR: [UPGRADE ERROR] Exit code 1; ++ adding generated column generated\_sent\_date -\> ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id) \ In AbstractMySQLDriver.php line 79: \ An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD ge nerated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sen t), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generate d)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_d ate_email_id` (generated\_sent\_date, email\_id)’: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ In MysqliStatement.php line 86: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ doctrine:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–all-or-nothing [ALL-OR-NOTHING]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] \  
[2020-10-13 11:16:17] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT t.generated\_sent\_date AS date, COUNT( _) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 11:16:17”]: Unknown column ‘t.generated\_sent\_date’ in ‘field list’" at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT t.generated\_sent\_date AS date, COUNT(_ ) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 11:16:17”]:\n\nUnknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”}  
[2020-10-13 11:16:24] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT t.generated\_sent\_date AS date, COUNT( _) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 11:16:24”]: Unknown column ‘t.generated\_sent\_date’ in ‘field list’" at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT t.generated\_sent\_date AS date, COUNT(_ ) AS count FROM mau86\_email\_stats t WHERE t.date\_sent BETWEEN ? AND ? GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 11:16:24”]:\n\nUnknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”}  
[2020-10-13 11:23:12] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT t.generated\_sent\_date AS date, COUNT( _) AS count FROM mau86\_email\_stats t WHERE (t.email\_id IN (13)) AND (t.date\_sent BETWEEN ? AND ?) GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 11:23:12”]: Unknown column ‘t.generated\_sent\_date’ in ‘field list’" at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 60 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT t.generated\_sent\_date AS date, COUNT(_ ) AS count FROM mau86\_email\_stats t WHERE (t.email\_id IN (13)) AND (t.date\_sent BETWEEN ? AND ?) GROUP BY t.generated\_sent\_date ORDER BY t.generated\_sent\_date ASC LIMIT 31’ with params [“2020-09-13 00:00:00”, “2020-10-13 11:23:12”]:\n\nUnknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘t.generated\_sent\_date’ in ‘field list’ at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”}  
[2020-10-13 18:19:38] mautic.NOTICE: Doctrine\DBAL\Exception\SyntaxErrorException: An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id)’: 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 ‘ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 (uncaught exception) at /home4/joylocxl/connect.joyloan.in/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command `doctrine:migrations:migrate`  
[2020-10-13 18:19:38] mautic.WARNING: Command `doctrine:migrations:migrate` exited with status code 1  
[2020-10-13 18:19:38] mautic.ERROR: [UPGRADE ERROR] Exit code 1; ++ adding generated column generated\_sent\_date -\> ALTER TABLE mau86\_email\_stats ADD generated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sent), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generated)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (generated\_sent\_date, email\_id) \ In AbstractMySQLDriver.php line 79: \ An exception occurred while executing ‘ALTER TABLE mau86\_email\_stats ADD ge nerated\_sent\_date DATE AS (CONCAT(YEAR(date\_sent), “-”, LPAD(MONTH(date\_sen t), 2, “0”), “-”, LPAD(DAY(date\_sent), 2, “0”))) COMMENT ‘(DC2Type:generate d)’; ALTER TABLE mau86\_email\_stats ADD INDEX `mau86_generated_sent_d ate_email_id` (generated\_sent\_date, email\_id)’: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ In MysqliStatement.php line 86: \ 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 ‘ALTER TABLE mau 86\_email\_stats ADD INDEX `mau86_generated_sent_date_email_id` (gen’ at line 2 \ doctrine:migrations:migrate [–write-sql [WRITE-SQL]] [–dry-run] [–query-time] [–allow-no-migration] [–all-or-nothing [ALL-OR-NOTHING]] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–] \

Steps I have tried to fix the problem:

---

<div class="post-metadata">

**Author:** ![devsrealm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/devsrealm/32/3669_2.png) [@devsrealm](https://forum.mautic.org/u/devsrealm)\
**Post date:** [October 14, 2020, 11:19am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/2 "2020-10-14T11:19:44Z")

</div>

Is this a shared hosting ?

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 14, 2020, 12:25pm UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/3 "2020-10-14T12:25:42Z")

</div>

What version of Mysql or Mariadb are you using? Minimum MySQL version is **5.7** or MariaDB **10.2**.

All those errors look like a failed/failing upgrade.  
Run the **doctrine:schema:validate** command via ssh and post results.

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 15, 2020, 10:01pm UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/4 "2020-10-15T22:01:06Z")

</div>

Yes. It is shared hosting…

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 15, 2020, 10:19pm UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/5 "2020-10-15T22:19:17Z")

</div>

SQL is showing 5.7.23-23

SSH is showing irrelevant option. It asks me to either Generate or Import Key.

There is another option to run some software command named **Terminal** : When I type " **doctrine:schema:validate**", it gives message command not found

I tried sudo **-u joylocxl php /home4/joylocxl/connect.joyloan.in/bin/console doctrine:schema:validate** , (as I do not know, what exact command to enter). There it gives error.  
_sudo: effective uid is not 0, is /bin/sudo in file system with nosuid option set or NFS file system without root privileges?_

I tried with diffrent method to enter the command, but there is error in Terminal every time. Please provide format of the command to enter in the terminal?

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 15, 2020, 11:58pm UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/6 "2020-10-15T23:58:44Z")

</div>

I recommend MobaXTerm for ssh. I use it every day and wont use anything else.  
The generate or import key it to securely login to your host. In my opinion your provider probably has blocked non secure connections as it is best practice or you were logging in for the first time from a new machine or with a new ssh client or both.  
On line 3 of your local.php file does it say ‘db\_driver’ =\> ‘pdo\_mysql’, if not copy paste ‘db\_driver’ =\> ‘pdo\_mysql’, to line three, save it and then try.

Its in your app/config folder.  
Can you do a dump of your current database and create a new one? Import the old database dump into the new one and change the appropriate setting your local file to have mautic connect to new database and see if the same errors occur?

Does your host provide you with Cpanel or Plesk?  
Have you looked at file permissions?

Have you looked in your var/spool folder to see if its full of unsent messages?  
Are you over your inode limit for your hosting package?

I know its alot of questions but the more we know the better we can help you troubleshoot these issues.

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 16, 2020, 12:10am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/7 "2020-10-16T00:10:57Z")

</div>

Third lines reads: ‘db\_driver’ =\> ‘mysqli’

Shall I replace it with **db\_driver’ =\> ‘pdo\_mysql?**

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 16, 2020, 12:12am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/8 "2020-10-16T00:12:15Z")

</div>

Yes indeed. I want to try to get you logged in first. We can address the ssh commands after.

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 16, 2020, 12:16am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/9 "2020-10-16T00:16:22Z")

</div>

I change the code on third line. Now when I try to go to dashboard, it gives message:

_Ready to Install!_

_Great! Your environment is ready for Mautic._

But I think, it is asking me to make install afresh. Then all my work within mautic will be lost

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 16, 2020, 12:20am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/10 "2020-10-16T00:20:36Z")

</div>

Post a screenshot of it. It may be trying to complete an incomplete upgrade. You can also try to run your ssh commands and see if the output differs as well.

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 16, 2020, 12:20am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/11 "2020-10-16T00:20:54Z")

</div>

On _Mautic Installation - Database Setup_ it is showing database and database user name prefilled.

And option of back-up existing database is there

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 16, 2020, 12:22am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/12 "2020-10-16T00:22:56Z")

</div>

![1](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/4/4f08c68d109d10c7be3a6723beddb60ffbb5dba7.png)

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 16, 2020, 12:28am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/13 "2020-10-16T00:28:16Z")

</div>

I have created RSA key in SSH and received the confirmation as below.

But I do not know how and where to run the command you suggested ( **doctrine:schema:validate** )

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 16, 2020, 12:32am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/14 "2020-10-16T00:32:18Z")

</div>

Line 121 in local.php says debug. set to true. save it.

ok. you have some choices here. You can try to validate your current schema , update your current schema via ssh.  
You can do the update process over via ssh and see if it will complete with the updated driver.

Third is backup existing mautic database, click install, and see if you can connect to the old database by changing config in local.php

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 16, 2020, 12:33am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/15 "2020-10-16T00:33:48Z")

</div>

You should delete everything in this post between the first line and the last line. Like this:

> [@ravinbhutani](#):
>
> I have created RSA key in SSH and received the confirmation as below.
> 
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
> xxxxxxxxxxxxx Dont Post Encryption Keysxxxxxxxxxxxxxxxxxxxxxxx  
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 
> But I do not know how and where to run the command you suggested ( **doctrine:schema:validate** )

Its a widely accepted practice not to post your encryption key info

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 16, 2020, 12:55am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/16 "2020-10-16T00:55:22Z")

</div>

> [@ravinbhutani](#):
>
> But I do not know how and where to run the command you suggested ( **doctrine:schema:validate** )

Start with this and adjust based on the accepted format for your system.

> [@ravinbhutani](#):
>
> php /home4/joylocxl/connect.joyloan.in/bin/console doctrine:schema:validate

Mine are  
/opt/plesk/php/7.3/bin/php /var/www/vhosts/MAUTICINSTALL/bin/console mautic:segments:rebuild

(centos7 with plesk panel)  
for example

---

<div class="post-metadata">

**Author:** ![ravinbhutani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ravinbhutani/32/412_2.png) [@ravinbhutani](https://forum.mautic.org/u/ravinbhutani)\
**Post date:** [October 16, 2020, 5:05am UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/17 "2020-10-16T05:05:52Z")

</div>

Thank you so much for your guidance. **Without you, it was not possible for me to correct this. 🙏**

**Method 3 worked for me ❤ (continue with install). Now it is working fine.**

Can you please tell me, what had gone wrong? I just triggered my first email send on Monday.

What I can do to avoid it in future?

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [October 16, 2020, 4:26pm UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/18 "2020-10-16T16:26:49Z")

</div>

I can’t speculate beyond the steps we took to fix it. I’m glad to be of some assistance.

---

<div class="post-metadata">

**Author:** ![MarcoCianci](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/marcocianci/32/4330_2.png) [@MarcoCianci](https://forum.mautic.org/u/MarcoCianci)\
**Post date:** [January 20, 2021, 8:40pm UTC](https://forum.mautic.org/t/sql-syntax-errors-mautic-3-1-1/16555/19 "2021-01-20T20:40:21Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b780b9f889cc10cfebd3207e812c4ad0a191d171.png)

I hope this can help you.  
As I told before, the “quotes” are wrongs.

* * *

edited  
So sorry, I replied in this post

> [@Column not found: 1054 Unknown column '-' in 'generated column function' when upgrading from 3.0.2 to 3.1](https://forum.mautic.org/t/column-not-found-1054-unknown-column-in-generated-column-function-when-upgrading-from-3-0-2-to-3-1/15869):
>
> Your software My PHP version is : 7.2 My MySQL version is (delete as applicable): MySQL 8 Updating/Installing Errors I am (delete as applicable): Updating Upgrading/installing via (delete as applicable) : Web or Command Line These errors are showing in the installer : Constant page redirects These errors are showing in the Mautic log : [2020-08-30 06:10:25] console.ERROR: Error thrown while running command "doctrine:migrations:migrate --quiet --no-interaction". Message: "An exception oc…
