Issues with migration after updating from 4.4 to 5.0.2

Your software
My Mautic version is: 5.0.2
My PHP version is: 8.0
My Database type and version is: MariaDB

Your problem
I managed to install the update through composer which very badly documented in my opinion.

My issue is that once i am opening the site, the dashboard keeps loading and loading. So i wanted to do the following step by running

php bin/console doctrine:migration:migrate --no-interaction

When i do that i get the following errors:

root@marketing /var/www/mautic # php bin/console doctrine:migration:migrate --no-interaction
[2024-02-02 09:40:50] 
[2024-02-02 09:40:50]                                                                                                                         
[2024-02-02 09:40:50]  [WARNING] You have 47 previously executed migrations in the database that are not registered migrations.               
[2024-02-02 09:40:50]                                                                                                                         
[2024-02-02 09:40:50] 
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:01 (20180508202930)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:01 (20180702014364)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:01 (20180702014365)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20180821144204)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20180921144421)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:47 (20181111095447)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20190704154940)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20190724110039)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:03 (20191017140848)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:48 (20191126093923)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20191206113956)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:48 (20191219155630)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:49 (20200211095409)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:58 (20200212141530)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:58 (20200220172041)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:59 (20200227110431)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:59 (20200302164801)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:02 (20200331160919)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:03 (20200409102100)
[2024-02-02 09:40:50]  >> 2020-09-14 09:21:59 (20200422144300)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:03 (20200507122854)
[2024-02-02 09:40:50]  >> 2022-03-20 08:27:03 (20200729170800)
[2024-02-02 09:40:50]  >> 2020-09-14 11:26:53 (20200805185714)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:00 (20200810153131)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20200812180900)
[2024-02-02 09:40:50]  >> 2020-09-14 11:26:53 (20200815153711)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20200924080139)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20201015084627)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20201102120710)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20201102133546)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:01 (20201105120328)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:02 (20201120122846)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201123070813)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201125155904)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20201130201631)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201207114926)
[2024-02-02 09:40:50]  >> 2021-10-26 08:49:04 (20201207140911)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20201228041109)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20210104171005)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:04 (20210203143600)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:05 (20210223174702)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:05 (20210502162314)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:08 (20210520100503)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20210609191822)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20210614151138)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20210623071326)
[2024-02-02 09:40:50]  >> 2022-03-20 08:42:09 (20220111202917)
[2024-02-02 09:40:50] [notice] Migrating up to Mautic\Migrations\Versionzz20230929183000
[error] Migration Mautic\Migrations\Version020230615115326 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`"

In ExceptionConverter.php line 117:
                                                                                                                                                                 
  An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`  
                                                                                                                                                                 

In Exception.php line 28:
                                                                                                                  
  SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`  
                                                                                                                  

In Connection.php line 71:
                                                                                                                  
  SQLSTATE[23000]: Integrity constraint violation: 4025 CONSTRAINT `emails.headers` failed for `mautic`.`emails`  
                                                                                                                  

doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--] [<version>]

I assume that the above issue might also be the reason my site does not load correctly?

Any ideas how i can solve this issue?

Same issue. Watching.

Any ideas @anyone ?

This happened to me too. Could not find any solution elsewhere.

Did you somehow solve the issue?

OK, figured that part out myself now, when opening the database and going to emails and then to the column headers you will see that very old emails have the headers blank while newer once have sinde them, character [ and ]
If you add those to the fields that are empty and than do the migration, then it will work.

BUT, i can into the NEXT issue then. Now it says:

Unknown column type “json_array” requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection
then you might have forgotten to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot som
e mapping information.

1 Like

OK, figured that out too, seems my database had like a duplicate inside with a different prefix. I removed those and now all migrations was successful.

BUUUUUT, when i am loading the dashboard it is still loading unendlessly.

THE PROBLEM is, that in the logs i dont get any errors, not in the apache logs and not in the mautic logs. ANY IDEAS?

Ok, my web browser does return some error in the console:

Failed to load resource: the server responded with a status of 404 (Not Found)
https://DOMAIN/media/libraries/ckeditor/ckeditor.js?vf12e105a

TypeError: undefined is not an object (evaluating ‘mQuery.FroalaEditor.ENTER_BR’)

ANY HELP HOW TO FIX THAT?

Can you try to regenerate assets?
bin/console m:a:g

When i try that it returns:

/var/www/mautic/node_modules does not exist. Execute npm install to generate it.

Well there you go :slight_smile: Now you know what to search for.

Thanks a lot, now i got it working.

After installing npm on my Debian, than running “npm install”, regenerating the assets and finally clearing the cache with

php bin/console cache:clear

Now it is running.
Wow, what a journey.

Congrats.
I hope you read all about email transports before you upgraded.

How did you update your Muatic version via composer?
I tried the following:
-Copied almost all the content from the composer.json from Mautic5 installation
-Copied almost all the content from the package.json from Mautic5 installation
-Copied webpack.config.js from Mautic5 installation
-Copied modernizr-config.json from Mautic5 installation
-Copied tsconfig.json from Mautic5 installation

I also ran composer install - composer update - npm install and even so, I got a lot of errors.

Finally, my Mautic 4.4.11 is on “docroot” but mautic 5 is not. so I’m guessing that I need to migrate the files over to make it work?

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.