M5 migration fails at doctrine:migrations:migrate

Trying to upgrade from Mautic 4 to Mautic 5 on a Ubuntu VPS using the command-line.

I have two instances, for two different domains, running on this server. One upgrade runs fine without hick-ups, the other breaks when running the Doctrine migration. I mention this because this seems to indicate that the server setup is correct, and that the problem might be in that particular Mautic instance.

Any help how to decipher the following error message after a

php bin/console doctrine:migrations:migrate

Thanks a bunch!

[notice] Migrating up to Mautic\Migrations\Versionzz20230929183000
[error] Migration Mautic\Migrations\Version020230615115326 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[22032]: <<Unknown error>>: 3140 Invalid JSON text: "The document is empty." at position 0 in value for column '#sql-46a_27.headers'."

In ExceptionConverter.php line 117:

  An exception occurred while executing a query: SQLSTATE[22032]: <<Unknown error>>: 3140 Invalid JSON text: "The document is empty." at position 0 in value for column '#sql-46a_27.headers'.


In Exception.php line 28:

  SQLSTATE[22032]: <<Unknown error>>: 3140 Invalid JSON text: "The document is empty." at position 0 in value for column '#sql-46a_27.headers'.


In Connection.php line 71:

  SQLSTATE[22032]: <<Unknown error>>: 3140 Invalid JSON text: "The document is empty." at position 0 in value for column '#sql-46a_27.headers'.


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>]

For the benefit of others to come after me, I noticed that the headers field in the emails table has some empty values:

$ mysql> select headers from emails;
+---------+
| headers |
+---------+
|         |
|         |
|         |
|         |
|         |
|         |
|         |
| []      |
| []      |
| []      |
| []      |
| []      |
| []      |
| []      |

Filling these in with
mysql> update emails set headers="[]"; and all is fine now.

1 Like

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