Error after update to Mautic5

Your software
My PHP version is : PHP 8.1.27
My MySQL/MariaDB version is: 10.6.12-MariaDB

Updating/Installing Errors
I’m Updating my server from Mautic 4.x to 5.0.1 via Command Line

These errors are showing in the installer :
On the terminal after running composer update I got:

$ composer update

Loading composer repositories with package information
Updating dependencies                                 
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package php-http/message-factory is abandoned, you should avoid using it. Use psr/http-factory instead.
Package sensio/framework-extra-bundle is abandoned, you should avoid using it. Use Symfony instead.
Generating autoload files
117 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Deprecation Notice: Return type of Mautic\Composer\Plugin\Scaffold\Operations\ScaffoldFileCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /srv/mautic/vendor/mautic/core-composer-scaffold/Operations/ScaffoldFileCollection.php:118
> npm ci --prefer-offline --no-audit
npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility

> mautic@0.0.0 postinstall
> node_modules/modernizr/bin/modernizr -c modernizr-config.json -d node_modules/modernizr/modernizr-mautic-dist.js & npm run build

Modernizr build saved to node_modules/modernizr/modernizr-mautic-dist.js

> mautic@0.0.0 build
> webpack --mode production  --config webpack.config.js

[CKEditorTranslationsPlugin] Error: No translation has been found for the en language.
asset ckeditor.js 1.23 MiB [emitted] [minimized] [big] (name: main) 2 related assets
cached modules 9.82 MiB (javascript) 919 bytes (runtime) [cached] 1616 modules
webpack 5.88.2 compiled successfully in 26561 ms

added 597 packages in 56s

73 packages are looking for funding
  run `npm fund` for details
> npx patch-package
patch-package 7.0.2
Applying patches...
at.js@1.5.4 ✔
chosen-js@1.8.7 ✔
You made a reference to a non-existent script @generate-assets
No security vulnerability advisories found

$ 

After that,I went to the browser saw the following message:
The "app/bundles/CoreBundle/Resources/views/Offline" directory does not exist ("//app/bundles/CoreBundle/Resources/views/Offline").

Also, I notice that the URL on the browser is https://server.com/index.php/installer

To “complete” the update from version 4 to 5, I had to basically make a brand new Mautic 5 with composer and then copy the composer.json file.
Here is how my composer.json look before I ran the update:
(its not 100% exact as the one Mautic5 generates but almost identical)

{
  "name": "mautic/recommended-project",
  "description": "Project template for Mautic 4 projects with composer",
  "type": "project",
  "license": "GPL-2.0-or-later",
  "homepage": "https://www.mautic.org/mautic-releases",
  "support": {
    "user-docs": "https://docs.mautic.org/en",
    "developer-docs": "https://developer.mautic.org",
    "chat": "https://www.mautic.org/slack"
  },
  "funding": [
    {
      "type": "other",
      "url": "https://opencollective.com/mautic"
    },
    {
      "type": "other",
      "url": "https://github.com/sponsors/mautic"
    }
  ],
  "authors": [
    {
      "name": "",
      "role": ""
    }
  ],
  "require": {
    "composer/installers": "^1.11",
    "mautic/core-composer-scaffold": "4.x-dev",
    "mautic/core-lib": "5.0.1",
    "mautic/core-project-message": "4.x-dev",
    "mautic/grapes-js-builder-bundle": "5.0.1",
    "mautic/plugin-clearbit": "5.0.1",
    "mautic/plugin-cloudstorage": "5.0.1",
    "mautic/plugin-crm": "5.0.1",
    "mautic/plugin-emailmarketing": "5.0.1",
    "mautic/plugin-focus": "5.0.1",
    "mautic/plugin-fullcontact": "5.0.1",
    "mautic/plugin-gmail": "5.0.1",
    "mautic/plugin-outlook": "5.0.1",
    "mautic/plugin-social": "5.0.1",
    "mautic/plugin-tagmanager": "5.0.1",
    "mautic/plugin-zapier": "5.0.1",
    "mautic/theme-aurora": "5.0.1",
    "mautic/theme-blank": "5.0.1",
    "mautic/theme-brienz": "5.0.1",
    "mautic/theme-cards": "5.0.1",
    "mautic/theme-coffee": "5.0.1",
    "mautic/theme-confirmme": "5.0.1",
    "mautic/theme-fresh-center": "5.0.1",
    "mautic/theme-fresh-fixed": "5.0.1",
    "mautic/theme-fresh-left": "5.0.1",
    "mautic/theme-fresh-wide": "5.0.1",
    "mautic/theme-goldstar": "5.0.1",
    "mautic/theme-mauve": "5.0.1",
    "mautic/theme-nature": "5.0.1",
    "mautic/theme-neopolitan": "5.0.1",
    "mautic/theme-oxygen": "5.0.1",
    "mautic/theme-paprika": "5.0.1",
    "mautic/theme-skyline": "5.0.1",
    "mautic/theme-sparse": "5.0.1",
    "mautic/theme-sunday": "5.0.1",
    "mautic/theme-trulypersonal": "5.0.1",
    "mautic/theme-vibrant": "5.0.1",
    "php-http/message-factory": "^1.1",
    "phpoffice/phpspreadsheet": "1.24.0"
  },
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/mautic/FOSOAuthServerBundle.git"
    },
    {
      "type": "git",
      "url": "https://github.com/mautic/SpBundle.git"
    },
    {
      "type": "git",
      "url": "https://github.com/mautic/SymfonyBridgeBundle.git"
    }
  ],
  "conflict": {
    "mautic/mautic": "*",
    "mautic/core": "*"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "sort-packages": true,
    "allow-plugins": {
      "composer/installers": true,
      "symfony/flex": true,
      "mautic/core-composer-scaffold": true,
      "mautic/core-project-message": true,
      "php-http/discovery": true
    }
  },
  "autoload": {
    "psr-4": {
      "MauticPlugin\\": "docroot/plugins/"
    }
  },
  "scripts": {                                                                                                     
    "post-install-cmd": [
      "@npm-ci",
      "@npx-patch-package",
      "@generate-assets"
    ],
    "post-update-cmd": [
      "@npm-ci",
      "@npx-patch-package",
      "@generate-assets"
    ],
    "npm-ci": "npm ci --prefer-offline --no-audit",
    "npx-patch-package": "npx patch-package"
  },  
  "extra": {
    "mautic-scaffold": {
      "locations": {
        "web-root": "docroot/"
      }
    },
    "installer-paths": {
      "docroot/app": [
        "type:mautic-core"
      ],
      "docroot/plugins/{$name}": [
        "type:mautic-plugin"
      ],
      "docroot/themes/{$name}": [
        "type:mautic-theme"
      ]
    },
    "mautic-core-project-message": {
      "include-keys": [
        "homepage",
        "support"
      ],
      "post-create-project-cmd-message": [
        "<bg=blue;fg=white>                                                         </>",
        "<bg=blue;fg=white>  Congratulations, you’ve installed the Mautic codebase  </>",
        "<bg=blue;fg=white>  from the mautic/recommended-project template!          </>",
        "<bg=blue;fg=white>                                                         </>",
        "",
        "<bg=yellow;fg=black>Next steps</>:",
        "  * Install Mautic",
        "  * Read the user guide",
        "  * Get support: https://www.mautic.org/support",
        "  * Get involved with the Mautic community:",
        "      https://www.mautic.org/getting-involved",
        "  * Remove the plugin that prints this message:",
        "      composer remove mautic/core-project-message"
      ]
    }
  }
}

I had to remove this line from the scripts section because I was getting an error;
"generate-assets": "php bin/console mautic:assets:generate"

These errors are showing in the Mautic log :
The error on the log file /var/log/nginx/mautic.error shows the following

2024/01/15 22:59:02 [error] 15649#15649: *185 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appendToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractIntegration::appendToForm(&$builder, $data, $formArea): void in /srv/mautic/docroot/plugins/MauticRecaptchaBundle/Integration/RecaptchaIntegration.php on line 51PHP message: PHP Notice: Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appendToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractIntegration::appendToForm(&$builder, $data, $formArea): void - in file /srv/mautic/docroot/plugins/MauticRecaptchaBundle/Integration/RecaptchaIntegration.php - at line 51PHP message: PHP Warning - Undefined variable $projectRoot - in file /srv/mautic/docroot/app/config/paths.php - at line 15PHP message: PHP Warning:  Undefined variable $projectRoot in /srv/mautic/docroot/app/config/paths.php on line 15PHP message: Symfony\Component\ErrorHandler\Error\FatalError: Notice: Declaration of MauticPlugin\MauticRecaptchaBundle\Integration\RecaptchaIntegration::appendToForm(&$builder, $data, $formArea) must be compatible with Mautic\PluginBundle\Integration\AbstractIntegration::appendToForm(&$builder, $data, $formArea): void - in file /srv/mautic/docroot/plugins/MauticRecaptchaBundle/Integration/RecaptchaIntegration.php - at line 51" while reading response header from upstream, client: 98.143.96.201, server: server.com, request: "GET /index.php/installer HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "server.com"

Hi there,

The docs for updating Mautic with Composer can be found here: Installation — Mautic Documentation 0.1 documentation

Please check this thread where we’re discussing: 4.4.10 → 5.0.1 fails because Symfony Path is not fount in ParameterLoader.php - #7 by mollux

The docs are not usable to update from V4 to V5 in a composer setup as of yet—unless the information mollux provided in the thread that you linked is merged there.

I’d do it, but I lack the knowledge if my setup is general enough to serve as basis for being in the docs.

He is asking for testers, prior to updating the docs. So if you can help with that testing, we can get the docs updated sooner :wink:

I’m trying to follow the docs on how to update Mautic:
https://docs.mautic.org/en/5.x/getting_started/how_to_update_mautic.html

So I did the following:

user@server:/srv/mautic$ php bin/console mautic:update:find
Version 5.0.2 of Mautic is available for download. Please visit https://github.com/mautic/mautic/releases/tag/5.0.2 for more information.
To update, you can run 'php bin/console mautic:update:apply' from the command line.

user@server:/srv/mautic$ php bin/console mautic:update:apply
You have Composer updates enabled. This means that you can only update Mautic through the 'composer update' command. Read more in the documentation: https://mau.tc/switch-to-composer

user@server:/srv/mautic$

Just as a side note, you guys should also include in the docs how to update Mautic using Composer.

Going back to the problem, I ran: composer update and got the following output:

user@server:/srv/mautic$ composer update
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires mautic/core-lib 4.4.10 -> satisfiable by mautic/core-lib[4.4.10].
    - mautic/core-lib 4.4.10 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires mautic/grapes-js-builder-bundle 4.4.9 -> satisfiable by mautic/grapes-js-builder-bundle[4.4.9].
    - mautic/grapes-js-builder-bundle 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 3
    - Root composer.json requires mautic/plugin-citrix 4.4.9 -> satisfiable by mautic/plugin-citrix[4.4.9].
    - mautic/plugin-citrix 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 4
    - Root composer.json requires mautic/plugin-clearbit 4.4.9 -> satisfiable by mautic/plugin-clearbit[4.4.9].
    - mautic/plugin-clearbit 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 5
    - Root composer.json requires mautic/plugin-cloudstorage 4.4.9 -> satisfiable by mautic/plugin-cloudstorage[4.4.9].
    - mautic/plugin-cloudstorage 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 6
    - Root composer.json requires mautic/plugin-crm 4.4.9 -> satisfiable by mautic/plugin-crm[4.4.9].
    - mautic/plugin-crm 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 7
    - Root composer.json requires mautic/plugin-emailmarketing 4.4.9 -> satisfiable by mautic/plugin-emailmarketing[4.4.9].
    - mautic/plugin-emailmarketing 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 8
    - Root composer.json requires mautic/plugin-focus 4.4.9 -> satisfiable by mautic/plugin-focus[4.4.9].
    - mautic/plugin-focus 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 9
    - Root composer.json requires mautic/plugin-fullcontact 4.4.9 -> satisfiable by mautic/plugin-fullcontact[4.4.9].
    - mautic/plugin-fullcontact 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 10
    - Root composer.json requires mautic/plugin-gmail 4.4.9 -> satisfiable by mautic/plugin-gmail[4.4.9].
    - mautic/plugin-gmail 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 11
    - Root composer.json requires mautic/plugin-outlook 4.4.9 -> satisfiable by mautic/plugin-outlook[4.4.9].
    - mautic/plugin-outlook 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 12
    - Root composer.json requires mautic/plugin-social 4.4.9 -> satisfiable by mautic/plugin-social[4.4.9].
    - mautic/plugin-social 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 13
    - Root composer.json requires mautic/plugin-tagmanager 4.4.9 -> satisfiable by mautic/plugin-tagmanager[4.4.9].
    - mautic/plugin-tagmanager 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 14
    - Root composer.json requires mautic/plugin-zapier 4.4.9 -> satisfiable by mautic/plugin-zapier[4.4.9].
    - mautic/plugin-zapier 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 15
    - Root composer.json requires mautic/theme-aurora 4.4.9 -> satisfiable by mautic/theme-aurora[4.4.9].
    - mautic/theme-aurora 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 16
    - Root composer.json requires mautic/theme-blank 4.4.9 -> satisfiable by mautic/theme-blank[4.4.9].
    - mautic/theme-blank 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 17
    - Root composer.json requires mautic/theme-brienz 4.4.9 -> satisfiable by mautic/theme-brienz[4.4.9].
    - mautic/theme-brienz 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 18
    - Root composer.json requires mautic/theme-cards 4.4.9 -> satisfiable by mautic/theme-cards[4.4.9].
    - mautic/theme-cards 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 19
    - Root composer.json requires mautic/theme-coffee 4.4.9 -> satisfiable by mautic/theme-coffee[4.4.9].
    - mautic/theme-coffee 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 20
    - Root composer.json requires mautic/theme-confirmme 4.4.9 -> satisfiable by mautic/theme-confirmme[4.4.9].
    - mautic/theme-confirmme 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 21
    - Root composer.json requires mautic/theme-fresh-center 4.4.9 -> satisfiable by mautic/theme-fresh-center[4.4.9].
    - mautic/theme-fresh-center 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 22
    - Root composer.json requires mautic/theme-fresh-fixed 4.4.9 -> satisfiable by mautic/theme-fresh-fixed[4.4.9].
    - mautic/theme-fresh-fixed 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 23
    - Root composer.json requires mautic/theme-fresh-left 4.4.9 -> satisfiable by mautic/theme-fresh-left[4.4.9].
    - mautic/theme-fresh-left 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 24
    - Root composer.json requires mautic/theme-fresh-wide 4.4.9 -> satisfiable by mautic/theme-fresh-wide[4.4.9].
    - mautic/theme-fresh-wide 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 25
    - Root composer.json requires mautic/theme-goldstar 4.4.9 -> satisfiable by mautic/theme-goldstar[4.4.9].
    - mautic/theme-goldstar 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 26
    - Root composer.json requires mautic/theme-mauve 4.4.9 -> satisfiable by mautic/theme-mauve[4.4.9].
    - mautic/theme-mauve 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 27
    - Root composer.json requires mautic/theme-nature 4.4.9 -> satisfiable by mautic/theme-nature[4.4.9].
    - mautic/theme-nature 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 28
    - Root composer.json requires mautic/theme-neopolitan 4.4.9 -> satisfiable by mautic/theme-neopolitan[4.4.9].
    - mautic/theme-neopolitan 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 29
    - Root composer.json requires mautic/theme-oxygen 4.4.9 -> satisfiable by mautic/theme-oxygen[4.4.9].
    - mautic/theme-oxygen 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 30
    - Root composer.json requires mautic/theme-paprika 4.4.9 -> satisfiable by mautic/theme-paprika[4.4.9].
    - mautic/theme-paprika 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 31
    - Root composer.json requires mautic/theme-skyline 4.4.9 -> satisfiable by mautic/theme-skyline[4.4.9].
    - mautic/theme-skyline 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 32
    - Root composer.json requires mautic/theme-sparse 4.4.9 -> satisfiable by mautic/theme-sparse[4.4.9].
    - mautic/theme-sparse 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 33
    - Root composer.json requires mautic/theme-sunday 4.4.9 -> satisfiable by mautic/theme-sunday[4.4.9].
    - mautic/theme-sunday 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 34
    - Root composer.json requires mautic/theme-trulypersonal 4.4.9 -> satisfiable by mautic/theme-trulypersonal[4.4.9].
    - mautic/theme-trulypersonal 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 35
    - Root composer.json requires mautic/theme-vibrant 4.4.9 -> satisfiable by mautic/theme-vibrant[4.4.9].
    - mautic/theme-vibrant 4.4.9 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
  Problem 36
    - mautic/core-lib 4.4.10 requires php >=7.4.0 <8.1 -> your php version (8.1.27) does not satisfy that requirement.
    - acquia/mc-cs-plugin-custom-objects 1.0.0 requires mautic/core-lib ^4.3 -> satisfiable by mautic/core-lib[4.4.10].
    - Root composer.json requires acquia/mc-cs-plugin-custom-objects ^1.0 -> satisfiable by acquia/mc-cs-plugin-custom-objects[1.0.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

This is why on my first post, I said that I had to manually change the composer.json file.

Im not sure if manually changing the file is the correct way of doing it or not.
If you guys could add some information on the docs about how to update from version 4 to 5 using composer that’d be awesome.

As I mentioned before, after I made the changes and run the update, I didnt have any issues with the output but I had a message on the browser.

Plus, I notied that if I made a brand new Mautic 5 folder, I cannot use the same database from version 4,. So I’m not sure if the update will also modify the db schema or if it will break it or if we will have to also make changes there.

Thanks.

See if the steps in 4.4.10 → 5.0.1 fails because Symfony Path is not fount in ParameterLoader.php - #10 by peter_k help.

Hi,
I have the same problem; interestingly, mine is a brand-new installation using Softaculous. After the successful install, I get the following error when trying to access the area:

The “app/bundles/CoreBundle/Resources/views/Offline” directory does not exist (“/home/thom/app/bundles/CoreBundle/Resources/views/Offline”).

Interesting is that the path is wrong. It did not point out the actual install path, which is:

/home/thom/domain_directorry/app/bundles/CoreBundle/Resources/views/Offline

Does anyone have a solution for this or know where this path is specified?

Thank you all for assisting

I got a similar message when upgrading to 5.0:

The "app/bundles/CoreBundle/Resources/views/Offline" directory does not exist ("/opt/cpanel/ea-php80/root/usr/bin/app/bundles/CoreBundle/Resources/views/Offline").

Here it seems its trying to find the dir in my PHP installation. I tried upgrading via mautic:update:apply.

Hello All,
How did you fixed this ?
I don’t see any solution here.
Daniel

I didn’t find a solution. We are going to build a new instance in 5 and manually rebuild our contacts and campaigns.

You tried this?: 4.4.10 → 5.0.1 fails because Symfony Path is not fount in ParameterLoader.php - #10 by peter_k