Your software
My Mautic version is: v2.15.3
My PHP version is: 7.1.33
Your problem
My problem is:
The update failed. The database didn’t update properly.
Now I can’t access Forms, and users can’t submit forms.
I have tried to update the database with the my-mautic-url/s/update/schema
With the error message:
An error occurred while updating the database. Check log for more details.
These errors are showing in the log:
[2019-11-29 13:24:42] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: “An exception occurred while executing ‘SELECT COUNT() AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.name AS name_11, m0_.description AS description_12, m0_.alias AS alias_13, m0_.form_attr AS form_attr_14, m0_.cached_html AS cached_html_15, m0_.post_action AS post_action_16, m0_.post_action_property AS post_action_property_17, m0_.publish_up AS publish_up_18, m0_.publish_down AS publish_down_19, m0_.template AS template_20, m0_.in_kiosk_mode AS in_kiosk_mode_21, m0_.render_style AS render_style_22, m0_.form_type AS form_type_23, m0_.no_index AS no_index_24, (SELECT count(m1_.id) AS dctrn__1 FROM maumi_form_submissions m1_ WHERE m1_.form_id = m0_.id) AS sclr_25 FROM maumi_forms m0_ LEFT JOIN maumi_categories m2_ ON m0_.category_id = m2_.id ORDER BY m0_.name ASC) dctrn_result) dctrn_table’: Unknown column ‘m0_.form_attr’ in ‘field list’" at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 71 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing 'SELECT COUNT() AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.name AS name_11, m0_.description AS description_12, m0_.alias AS alias_13, m0_.form_attr AS form_attr_14, m0_.cached_html AS cached_html_15, m0_.post_action AS post_action_16, m0_.post_action_property AS post_action_property_17, m0_.publish_up AS publish_up_18, m0_.publish_down AS publish_down_19, m0_.template AS template_20, m0_.in_kiosk_mode AS in_kiosk_mode_21, m0_.render_style AS render_style_22, m0_.form_type AS form_type_23, m0_.no_index AS no_index_24, (SELECT count(m1_.id) AS dctrn__1 FROM maumi_form_submissions m1_ WHERE m1_.form_id = m0_.id) AS sclr_25 FROM maumi_forms m0_ LEFT JOIN maumi_categories m2_ ON m0_.category_id = m2_.id ORDER BY m0_.name ASC) dctrn_result) dctrn_table’:\n\nUnknown column ‘m0_.form_attr’ in ‘field list’ at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘m0_.form_attr’ in ‘field list’ at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:101)”}
[2019-11-29 13:27:55] mautic.NOTICE: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: Can’t write; duplicate key in table ‘#sql-201f_424150’ (uncaught exception) at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 while running console command doctrine:migrations:migrate
[2019-11-29 13:27:55] mautic.ERROR: [UPGRADE ERROR] Exit code 1; Mautic Migrations \ Migrating up to 20190715065013 from 20160630000000 \ ++ migrating 20160630000001 \ -> ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL Migration 20160630000001 failed during Execution. Error An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: \ Can’t write; duplicate key in table ‘#sql-201f_424150’ \ [Doctrine\DBAL\Exception\DriverException] An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: \ Can’t write; duplicate key in table ‘#sql-201f_424150’ \ [Doctrine\DBAL\Driver\Mysqli\MysqliException] Can’t write; duplicate key in table ‘#sql-201f_424150’ \ doctrine:migrations:migrate [–write-sql] [–dry-run] [–query-time] [–allow-no-migration] [–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] [-s|–shell] [–process-isolation] [-e|–env ENV] [–no-debug] [–] [] \
[2019-11-29 13:29:40] mautic.NOTICE: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: Can’t write; duplicate key in table ‘#sql-201f_4243d7’ (uncaught exception) at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 while running console command doctrine:migrations:migrate
[2019-11-29 13:29:40] mautic.ERROR: [UPGRADE ERROR] Exit code 1; Mautic Migrations \ Migrating up to 20190715065013 from 20160630000000 \ ++ migrating 20160630000001 \ -> ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL Migration 20160630000001 failed during Execution. Error An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: \ Can’t write; duplicate key in table ‘#sql-201f_4243d7’ \ [Doctrine\DBAL\Exception\DriverException] An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: \ Can’t write; duplicate key in table ‘#sql-201f_4243d7’ \ [Doctrine\DBAL\Driver\Mysqli\MysqliException] Can’t write; duplicate key in table ‘#sql-201f_4243d7’ \ doctrine:migrations:migrate [–write-sql] [–dry-run] [–query-time] [–allow-no-migration] [–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] [-s|–shell] [–process-isolation] [-e|–env ENV] [–no-debug] [–] [] \
[2019-11-29 13:29:40] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/home/virtu149/public_html/mautic/app/cache/prod/doctrine/orm/Proxies/CG__MauticPluginBundleEntityPlugin.php’ (include_path=’.:/usr/local/php71/pear’) - in file /home/virtu149/public_html/mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []
[2019-11-29 13:29:40] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/home/virtu149/public_html/mautic/app/cache/prod/doctrine/orm/Proxies/CG__MauticPluginBundleEntityPlugin.php’ (include_path=’.:/usr/local/php71/pear’) - in file /home/virtu149/public_html/mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []
[2019-11-29 13:29:40] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening required '/home/virtu149/public_html/mautic/app/cache/prod/doctrine/orm/Proxies/CG__MauticPluginBundleEntityPlugin.php’ (include_path=’.:/usr/local/php71/pear’)" at /home/virtu149/public_html/mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 209 {“exception”:"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile Error: require(): Failed opening required '/home/virtu149/public_html/mautic/app/cache/prod/doctrine/orm/Proxies/CG__MauticPluginBundleEntityPlugin.php’ (include_path=’.:/usr/local/php71/pear’) at /home/virtu149/public_html/mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209)"} []
[2019-11-29 13:30:10] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\InvalidFieldNameException: "An exception occurred while executing 'SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0.is_published AS is_published_0, m0.date_added AS date_added_1, m0.created_by AS created_by_2, m0.created_by_user AS created_by_user_3, m0.date_modified AS date_modified_4, m0.modified_by AS modified_by_5, m0.modified_by_user AS modified_by_user_6, m0.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.name AS name_11, m0_.description AS description_12, m0_.alias AS alias_13, m0_.form_attr AS form_attr_14, m0_.cached_html AS cached_html_15, m0_.post_action AS post_action_16, m0_.post_action_property AS post_action_property_17, m0_.publish_up AS publish_up_18, m0_.publish_down AS publish_down_19, m0_.template AS template_20, m0_.in_kiosk_mode AS in_kiosk_mode_21, m0_.render_style AS render_style_22, m0_.form_type AS form_type_23, m0_.no_index AS no_index_24, (SELECT count(m1_.id) AS dctrn__1 FROM maumi_form_submissions m1_ WHERE m1_.form_id = m0_.id) AS sclr_25 FROM maumi_forms m0_ LEFT JOIN maumi_categories m2_ ON m0_.category_id = m2_.id ORDER BY m0_.name ASC) dctrn_result) dctrn_table’: Unknown column ‘m0_.form_attr’ in ‘field list’" at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 71 {“exception”:"[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 0): An exception occurred while executing ‘SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.name AS name_11, m0_.description AS description_12, m0_.alias AS alias_13, m0_.form_attr AS form_attr_14, m0_.cached_html AS cached_html_15, m0_.post_action AS post_action_16, m0_.post_action_property AS post_action_property_17, m0_.publish_up AS publish_up_18, m0_.publish_down AS publish_down_19, m0_.template AS template_20, m0_.in_kiosk_mode AS in_kiosk_mode_21, m0_.render_style AS render_style_22, m0_.form_type AS form_type_23, m0_.no_index AS no_index_24, (SELECT count(m1_.id) AS dctrn__1 FROM maumi_form_submissions m1_ WHERE m1_.form_id = m0_.id) AS sclr_25 FROM maumi_forms m0_ LEFT JOIN maumi_categories m2_ ON m0_.category_id = m2_.id ORDER BY m0_.name ASC) dctrn_result) dctrn_table’:\n\nUnknown column ‘m0_.form_attr’ in ‘field list’ at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘m0_.form_attr’ in ‘field list’ at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:101)"}
[2019-11-29 13:30:17] mautic.NOTICE: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: Can’t write; duplicate key in table ‘#sql-201f_42450b’ (uncaught exception) at /home/virtu149/public_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 while running console command doctrine:migrations:migrate
[2019-11-29 13:30:17] mautic.ERROR: [UPGRADE ERROR] Exit code 1; Mautic Migrations \ Migrating up to 20190715065013 from 20160630000000 \ ++ migrating 20160630000001 \ -> ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL Migration 20160630000001 failed during Execution. Error An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: \ Can’t write; duplicate key in table ‘#sql-201f_42450b’ \ [Doctrine\DBAL\Exception\DriverException] An exception occurred while executing ‘ALTER TABLE maumi_leads ADD CONSTRAINT FK_D7C37362298D193 FOREIGN KEY (stage_id) REFERENCES maumi_stages (id) ON DELETE SET NULL’: \ Can’t write; duplicate key in table ‘#sql-201f_42450b’ \ [Doctrine\DBAL\Driver\Mysqli\MysqliException] Can’t write; duplicate key in table ‘#sql-201f_42450b’ \ doctrine:migrations:migrate [–write-sql] [–dry-run] [–query-time] [–allow-no-migration] [–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] [-s|–shell] [–process-isolation] [-e|–env ENV] [–no-debug] [–] [] \
How could I fix this?
Thanks,
Davor