Error after upgrading to 4.2 clearing cache fails and error: Unknown column last_built_date in field list

Your software
My PHP version is : 7.4
My MySQL/MariaDB version is (delete as applicable): MySQL/MariaDB version MySQL 5

Updating/Installing Errors
I am (delete as applicable): Updating
Upgrading/installing via (delete as applicable) : Web

These errors are showing in the installer :

These errors are showing in the Mautic log :

[2022-03-01 15:53:02] mautic.NOTICE: Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing ‘SELECT l0_.is_published AS is_published_0, l0_.date_added AS date_added_1, l0_.created_by AS created_by_2, l0_.created_by_user AS created_by_user_3, l0_.date_modified AS date_modified_4, l0_.modified_by AS modified_by_5, l0_.modified_by_user AS modified_by_user_6, l0_.checked_out AS checked_out_7, l0_.checked_out_by AS checked_out_by_8, l0_.checked_out_by_user AS checked_out_by_user_9, l0_.id AS id_10, l0_.name AS name_11, l0_.description AS description_12, l0_.alias AS alias_13, l0_.public_name AS public_name_14, l0_.filters AS filters_15, l0_.is_global AS is_global_16, l0_.is_preference_center AS is_preference_center_17, l0_.last_built_date AS last_built_date_18, l0_.category_id AS category_id_19 FROM lead_lists l0_ LEFT JOIN categories c1_ ON l0_.category_id = c1_.id ORDER BY l0_.name ASC’: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘l0_.last_built_date’ in ‘field list’ (uncaught exception) at /home/agwmadmin/mas.agwm.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command mautic:segments:update
[2022-03-01 15:53:02] mautic.WARNING: Command mautic:segments:update exited with status code 1
[2022-03-01 15:58:01] mautic.NOTICE: Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing ‘SELECT l0_.is_published AS is_published_0, l0_.date_added AS date_added_1, l0_.created_by AS created_by_2, l0_.created_by_user AS created_by_user_3, l0_.date_modified AS date_modified_4, l0_.modified_by AS modified_by_5, l0_.modified_by_user AS modified_by_user_6, l0_.checked_out AS checked_out_7, l0_.checked_out_by AS checked_out_by_8, l0_.checked_out_by_user AS checked_out_by_user_9, l0_.id AS id_10, l0_.name AS name_11, l0_.description AS description_12, l0_.alias AS alias_13, l0_.public_name AS public_name_14, l0_.filters AS filters_15, l0_.is_global AS is_global_16, l0_.is_preference_center AS is_preference_center_17, l0_.last_built_date AS last_built_date_18, l0_.category_id AS category_id_19 FROM lead_lists l0_ LEFT JOIN categories c1_ ON l0_.category_id = c1_.id ORDER BY l0_.name ASC’: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘l0_.last_built_date’ in ‘field list’ (uncaught exception) at /home/agwmadmin/mas.agwm.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command mautic:segments:update
[2022-03-01 15:58:01] mautic.WARNING: Command mautic:segments:update exited with status code 1
[2022-03-01 16:03:02] mautic.NOTICE: Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing ‘SELECT l0_.is_published AS is_published_0, l0_.date_added AS date_added_1, l0_.created_by AS created_by_2, l0_.created_by_user AS created_by_user_3, l0_.date_modified AS date_modified_4, l0_.modified_by AS modified_by_5, l0_.modified_by_user AS modified_by_user_6, l0_.checked_out AS checked_out_7, l0_.checked_out_by AS checked_out_by_8, l0_.checked_out_by_user AS checked_out_by_user_9, l0_.id AS id_10, l0_.name AS name_11, l0_.description AS description_12, l0_.alias AS alias_13, l0_.public_name AS public_name_14, l0_.filters AS filters_15, l0_.is_global AS is_global_16, l0_.is_preference_center AS is_preference_center_17, l0_.last_built_date AS last_built_date_18, l0_.category_id AS category_id_19 FROM lead_lists l0_ LEFT JOIN categories c1_ ON l0_.category_id = c1_.id ORDER BY l0_.name ASC’: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘l0_.last_built_date’ in ‘field list’ (uncaught exception) at /home/agwmadmin/mas.agwm.org/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 79 while running console command mautic:segments:update
[2022-03-01 16:03:02] mautic.WARNING: Command mautic:segments:update exited with status code 1

Your problem
My problem is :

After the update, I get this email every time the cronjob "console mautic:segments:update
" is executed

In AbstractMySQLDriver.php line 79:

An exception occurred while executing ‘SELECT l0_.is_published AS is_publis
hed_0, l0_.date_added AS date_added_1, l0_.created_by AS created_by_2, l0_.
created_by_user AS created_by_user_3, l0_.date_modified AS date_modified_4,
l0_.modified_by AS modified_by_5, l0_.modified_by_user AS modified_by_user
6, l0.checked_out AS checked_out_7, l0_.checked_out_by AS checked_out_by_
8, l0_.checked_out_by_user AS checked_out_by_user_9, l0_.id AS id_10, l0_.n
ame AS name_11, l0_.description AS description_12, l0_.alias AS alias_13, l
0_.public_name AS public_name_14, l0_.filters AS filters_15, l0_.is_global
AS is_global_16, l0_.is_preference_center AS is_preference_center_17, l0_.l
ast_built_date AS last_built_date_18, l0_.category_id AS category_id_19 FRO
M lead_lists l0_ LEFT JOIN categories c1_ ON l0_.category_id = c1_.id ORDER
BY l0_.name ASC’:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'l0_.last_built_date
’ in ‘field list’

In Exception.php line 18:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'l0_.last_built_date
’ in ‘field list’

In PDOConnection.php line 132:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'l0_.last_built_date
’ in ‘field list’

mautic:segments:update [-b|–batch-limit [BATCH-LIMIT]] [-m|–max-contacts [MAX-CONTACTS]] [-i|–list-id [LIST-ID]] [-tm|–timing [TIMING]] [–bypass-locking] [-t|–timeout TIMEOUT] [-x|–lock_mode LOCK_MODE] [-f|–force] [-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 :

Please advise how to fix it

Thank you

Hi there,

How did you do the update? Did you have any errors or problems?

I updated through the alert notification in admin area. I noticed that when it got to the part where it said something about cache during the update then it paused for a long time there. The spinning stopped spinning.

Right - @tobsowo had a similar problem. Other than the usual ‘don’t update in the browser’ message, here’s what helped him:

  1. Clear the cache by deleting the cache folder
  2. Follow these steps:

Using ssh following the instruction on the page.

First step give me this error in command line

// Clearing the cache for the prod environment with debug
// false

In SalesforceIntegration.php line 1380:

Error: Allowed memory size of 100663296 bytes exhausted (tried to allocate
32768 bytes)

cache:clear [–no-warmup] [–no-optional-warmers] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

I skipped on ahead and deleted the cache then doing the next steps now …

Clearing the cache error above suggests running out of memory while processing the task. So maybe the server’s php limits need to be increased :slight_smile:

Had a similar challenge and was about to solve it using the doc link shared above in the following steps:

  1. Stop the update by refreshing your browser
  2. Clear cache (I did this on the file manager and CLI)
  3. Add this to your instance URL “/update/schema”
  4. Go to your dashboard or try it using incognito

Memory limit is already set to 512M.

Most php script don’t even need more than 64M …

Are you saying that Mautic need more php memory?

I am at the step where I did php bin/console doctrine:migration:migrate …

It been 30 minutes and still processing … is this normal?

Thanks … we resume the cronjob and so far no errors after doing both @rcheesley and your suggestions to fix this issue.

We may go ahead and trash this Mautic install since we installed it when 4.0 first came out last year and we really haven’t made the move over to it yet due to bugs we keep discovering on it so our are still in a “testing” stage.

Our first install was done via zip file and now with new Marketplace which require composer install so we are checking to see if composer would work alongside with cPanel and reinstall Mautic using composer instead.

We really want to start using Mautic but kept running into bugs or missing features especially in the grapejs editor area so we been holding it off for now until most of bug eliminated or missing features added in.

With Composer I guess most of what you’ve been looking for would have been available.

That may not be the PHP limit that your command line is using. Often they have different limits to the web folder.

I just installed composer on my server and did a fresh install on a unused domain to test it out. Seems to work fine.

Can the zip mautic be completely deleted and composer mautic install in it place but use the same database or I have to start fresh if I switch over to composer?

It no big loss but just having to reconfigured everything especially with AWS account is time comsuming.

Thanks

It’s the server php.ini what I call it and I am already aware that it applies to CLI. I checked … it was set at 128M so I increased it to 512M.

Thank you

I had a similar problem. Running console doctrine:migration:migrate
did the trick.
By the way, it is the first time I am running into problems updating from the web interface. I wonder whether there are some issues in the 4.2 update routine.

1 Like

We made a lot of changes in 4.2, so entirely possible. Of note is that we will be fully removing the ability to update in the user interface in Mautic 5. Read more here: Important changes to the Mautic install and upgrade process.

A post was split to a new topic: Problems with failed web update