Getting 500 error after upgrade

Your software
My Mautic version is: Upgrade from 4 to 5
My PHP version is: 8.0.30
My Database type and version is: MariaDB 10.5.24

Your problem
My problem is:
While upgrading, from the frontend, the process got stuck at ‘Move Package Contents’.
Visiting our Mautic setup now throws a PHP 500 error

These errors are showing in the log:
AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught TypeError: Symfony\Component\Dotenv\Dotenv::loadEnv(): Argument #2 ($varName) must be of type string, null given, called in /var/www/vhosts/mailagent.nl/app.mailagent.nl/app/config/bootstrap.php on line 20 and defined in /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/symfony/dotenv/Dotenv.php:82\nStack trace:\n#0 /var/www/vhosts/mailagent.nl/app.mailagent.nl/app/config/bootstrap.php(20): Symfony\Component\Dotenv\Dotenv->loadEnv()\n#1 /var/www/vhosts/mailagent.nl/app.mailagent.nl/index.php(9): require(’…‘)\n#2 {main}\n thrown in /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/symfony/dotenv/Dotenv.php on line 82’

running the composer through command line is giving me the following errors:
PHP Fatal error: Declaration of Symfony\Flex\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Composer\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/symfony/flex/src/Command/RemoveCommand.php on line 36

Fatal error: Declaration of Symfony\Flex\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Composer\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/symfony/flex/src/Command/RemoveCommand.php on line 36

Steps I have tried to fix the problem:

  • delete the files in /var/cache
  • read a lot of blogposts and tried almost all given solutions…

Could you please go back to your last working backup and try again?
This time please use the console / command line interface. It will probably save a lot of time, compared to trying to fix a broken update.

https://docs.mautic.org/en/5.x/getting_started/how_to_update_mautic.html

You will find the how-to for composer-based and non-composer-based setups.

(Please never ever use the frontend for updating.)

1 Like

@dirk_s : thank you for your assistance. I’ve now restored all files and run the update through command line.

After running the --finish command an error thrown (at point 2, updating database) pointing me to the logfile.
In the logfile the following error is given:

[2024-04-24T16:12:15.589656+00:00] console.CRITICAL: Error thrown while running command “doctrine:migrations:migrate --quiet --no-interaction”. Message: “An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’” {“exception”:“[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 1054): An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’ at /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67)\n[previous exception] [object] (Doctrine\DBAL\Driver\PDO\Exception(code: 1054): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’ at /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’ at /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:71)”,“command”:“doctrine:migrations:migrate --quiet --no-interaction”,“message”:“An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’”} {“hostname”:“h2399465.stratoserver.net”,“pid”:28545}
[2024-04-24T16:12:23.495375+00:00] console.CRITICAL: Error thrown while running command “doctrine:migrations:migrate --quiet --no-interaction”. Message: “An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’” {“exception”:“[object] (Doctrine\DBAL\Exception\InvalidFieldNameException(code: 1054): An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’ at /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67)\n[previous exception] [object] (Doctrine\DBAL\Driver\PDO\Exception(code: 1054): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’ at /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’ at /var/www/vhosts/mailagent.nl/app.mailagent.nl/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:71)”,“command”:“doctrine:migrations:migrate --quiet --no-interaction”,“message”:“An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘conditions’ in ‘form_fields’”} {“hostname”:“h2399465.stratoserver.net”,“pid”:28573}

The Mautic login page is shown, but after login a PHP 500 error is given.

Is this something you can help me with?