Mautic Update Issues (Segment Tab inside Mautic Wont Open On Click!)

My software Mautic v 3.0.2 (Updating to v 3.2.2)
My PHP version is : PHP Version 7.2.34 (Linus vps server)
MariaDB version is 10.3.27

Updating Errors From the Log file

[2020-12-30 12:12:11] 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_.public_name AS public_name_14, m0_.filters AS filters_15, m0_.is_global AS is_global_16, m0_.is_preference_center AS is_preference_center_17 FROM maukx_lead_lists m0_ ORDER BY m0_.name ASC) dctrn_result) dctrn_table’: Unknown column ‘m0_.public_name’ in ‘field list’" at /home/beau********/public_html/mauticvtest/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 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_.public_name AS public_name_14, m0_.filters AS filters_15, m0_.is_global AS is_global_16, m0_.is_preference_center AS is_preference_center_17 FROM maukx_lead_lists m0_ ORDER BY m0_.name ASC) dctrn_result) dctrn_table’:\n\nUnknown column ‘m0_.public_name’ in ‘field list’ at /home/beau********/public_html/mauticvtest/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:60, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): Unknown column ‘m0_.public_name’ in ‘field list’ at /home/beau********/public_html/mauticvtest/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)"}

My Issues

  1. I was unable to install the Mautic 3.2.2 update via the command line, it keeps timing out (probably internet download issues)

STEPS I TOOK TO ADDRESS IT:

I downloaded the v3.2.2 from the GitHub and did a manual update via CPANEL.

Installation managed through… with cache clearing… I could re-access my mautic dashboard.

MY PROBLEM NOW

However, the SEGMENT TAB in my instance is inaccessible… it just attempts to load… but stops and then remain on the same window.

Steps I have tried to fix the problem :
I have cleared cache…via Command Line… but the issue still persists though.
(Seems to me like a database issue, but i don’t know enough to know how to find the solution)

Thank you

Please help, I appreciate your time.

@devsrealm @joeyk @EJL

Try updating the schema, I think that should fix it: example.com/s/update/schema

thanks man, i got an error

What is your last mautic log message

Last Error Log

[2020-12-30 13:23:29] mautic.ERROR: [UPGRADE ERROR] Exit code 1; ++ adding generated column generated_sent_date -> ALTER TABLE maukx_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 maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(generated_sent_date, email_id) \ In AbstractMySQLDriver.php line 79: \ An exception occurred while executing ‘ALTER TABLE maukx_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 maukx_email_stats ADD INDEX maukx_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 MariaDB server version for the right syntax to use near ‘ALTER TABLE m aukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(…’ at lin e 2 \ In MysqliStatement.php line 86: \ You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘ALTER TABLE m aukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(…’ at lin e 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] [–] \

When I ran the update schema command via ssh it took FOREVER to finish. I would think it would likely timeout if ran via web. Try schema update command via SSH

1 Like

thank you SO MUCH@EJL i appreciate your input on my issue.

I had earlier tried updating the schema via SSH but had some hiccups. But in the end these are some few steps that actually solved the issue.

@devsrealm helped with the solution.

The steps I followed to Solve the Update Issue

  1. I made a clone of my main mautic instance and did all the update test on the clone instance.
  2. Log into my mautic instance via SSH
  3. I cleared mautic cache (using the command)
  4. I performed the Find_Update commands

Please Note after the update was completed, Mautic threw up some errors and asked i check my log file for the error details

This is the error

[****@vps***** mauticvtest2]# php bin/console mautic:update:apply --finish
Step 1 [->--------------------------] Migrating database schema…
An error occurred while updating the database. Check log for more details.

LOG DETAILS OF THE ERROR

] console.ERROR: Error thrown while running command “doctrine:migrations:migrate --quiet --no-interaction”. Message: “An exception occurred while executing ‘ALTER TABLE maukx_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 maukx_email_stats ADD INDEX maukx_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 MariaDB server version for the right syntax to use near ‘ALTER TABLE maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(…’ at line 2” {“exception”:“[object] (Doctrine\DBAL\Exception\SyntaxErrorException(code: 0): An exception occurred while executing ‘ALTER TABLE maukx_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)’;\n ALTER TABLE maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(generated_sent_date, email_id)’:\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘ALTER TABLE maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(…’ at line 2 at /home/b***************/public_html/maut****test2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:79, Doctrine\DBAL\Driver\Mysqli\MysqliException(code: 0): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘ALTER TABLE maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(…’ at line 2 at /home/b */public_html/mt2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:86)”,“command”:“doctrine:migrations:migrate --quiet --no-interaction”,“message”:“An exception occurred while executing ‘ALTER TABLE maukx_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)’;\n ALTER TABLE maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(generated_sent_date, email_id)’:\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘ALTER TABLE maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(…’ at line 2”}

THE 1ST SOLUTION FOR THIS DATABASE ERROR

  1. recursively chown your directory to your user, use: **sudo chown -R b***ma****ng(use your own username):b****ma***ng /home/b****ma***ng/public_html/ma***** (use-your-own-mautic-directory**)

NOTE
With this chown R command i could now access my mautic dashboad and my segment tab and every other tabs now function…

ISSUE NO 2
However, when we checked the database schema status via : https://bng.com/m***v(use_your_own_mautic_url)/s/update/schema

An error occurred while updating the database. Check log for more details.

On check the log this is the error

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘ALTER TABLE maukx_email_stats ADD INDEX maukx_generated_sent_date_email_id(…’ at line 2 (uncaught exception) at /home/beautymarketing/public_html/mauticvtest2/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command doctrine:migrations:migrate

SOLUTION TO THE ISSUE

  1. Open the local.php file in your mautic app folder (your app/config)
  2. Check if this line is there: 'db_driver' => 'pdo_mysql (around line three)

Mine was ‘db_driver’ => ‘mysqli’

  1. So I replaced ‘mysqli’ with ‘pdo_mysql’
  2. Then save the file.

I then i try updating the schema again… This WORKED!!

  1. I then updated mautic to the latest version 3.2.2
    No Issues other than inability to access my dashboard after successful update.

The solution to this

recursively chown your directory to your user, use: **sudo chown -R b***ma****ng(use your own username):b****ma***ng /home/b****ma***ng/public_html/ma***** (use-your-own-mautic-directory**)

NOTE
With this chown R command i could now access my mautic dashboad and my segment tab and every other tabs now function.

Hope this helps someone.
Thanks @Devsrealm & @EJL

3 Likes

Hey @dewale.michael ,

Thank you! This worked for me on namecheap server:

  • Server: Localhost via UNIX socket
  • Server type: MariaDB
  • Server version: 10.3.37-MariaDB-log-cll-lve - MariaDB Server
  • Protocol version: 10
  • Server charset: cp1252 West European (latin1)

Mautic v4.4.5