4.4.10 → 5.0.1 fails because Symfony Path is not fount in ParameterLoader.php

Your software
My Mautic version is: 4.10 → 5.0.1
My PHP version is:

PHP 8.1.27 (cli) (built: Dec 19 2023 20:35:55) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.27, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.27, Copyright (c), by Zend Technologies

Your problem

I tried to update from 4.10 to 5.0.1.

mautic:update:apply --finish results in an error because
the class Symfony\Component\Filesystem\Path
is not found in CoreBundle/Loader/ParameterLoader.php:198

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

$ php bin/console mautic:update:apply
Are you sure you wish to update Mautic to the latest version? y
Step    7 [------->--------------------] Clearing the cache

<warning>IMPORTANT: Run the same command again with --finish. For example 'php bin/console mautic:update:apply --finish'</warning>

The update itself went through, but finishing it results in an exception being thrown:

$ php bin/console mautic:update:apply --finish
PHP Fatal error:  Uncaught Error: Class "Symfony\Component\Filesystem\Path" not found in .../mautic/docroot/app/bundles/CoreBundle/Loader/ParameterLoader.php:198
Stack trace:
#0 .../mautic/docroot/app/bundles/CoreBundle/Loader/ParameterLoader.php(31): Mautic\CoreBundle\Loader\ParameterLoader::getLocalConfigBaseDir('/var/www/virtua...')
#1 .../mautic/docroot/app/AppKernel.php(358): Mautic\CoreBundle\Loader\ParameterLoader->__construct()
#2 .../mautic/docroot/app/AppKernel.php(228): AppKernel->getParameterLoader()
#3 .../mautic/vendor/symfony/framework-bundle/Console/Application.php(169): AppKernel->boot()
#4 .../mautic/vendor/symfony/framework-bundle/Console/Application.php(75): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()
#5 .../mautic/vendor/symfony/console/Application.php(149): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 .../mautic/bin/console(42): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 {main}
  thrown in .../mautic/docroot/app/bundles/CoreBundle/Loader/ParameterLoader.php on line 198

Steps I have tried to fix the problem:

  • cleared the cache rm -rf ./docroot/var/cache/*

Any help is much appreciated.

Since you have your Mautic installation in the docroot directory, didn’t you install Mautic via Composer? If so, you should use composer to update Mautic.

The problem isn’t in the code itself, but it seems your Mautic installation is missing this file:

vendor/symfony/filesystem/Path.php

Can you check if it exists in your filesystem?

Rrrrright :man_facepalming:

Installed it via composer create-project mautic/recommended-project:^4

Next embarrasment: How?

$ 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


$ composer require "mautic/core": "^5.0" --with-all-dependencies

./composer.json has been updated
Running composer update mautic/core --with-all-dependencies
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mautic/recommended-project 1.0.0+no-version-set conflicts with mautic/core 5.0.0-alpha1.
    - mautic/recommended-project 1.0.0+no-version-set conflicts with mautic/core 5.0.0-alpha.
    - mautic/core[5.0.0-beta1, ..., 5.x-dev] require mautic/core-lib ^5.0 -> found mautic/core-lib[5.0.0-alpha, ..., 5.x-dev] but it conflicts with your root composer.json require (4.4.9).
    - mautic/recommended-project is present at version 1.0.0+no-version-set and cannot be modified by Composer
    - Root composer.json requires mautic/core ^5.0 -> satisfiable by mautic/core[5.0.0-alpha, ..., 5.x-dev].


Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Composer is always a bumpy ride for me…


I’ve got this issue while updating from 4.4 to 5.0 (after updated from php 7.4 to php 8.0.3)
Someone knows the solution?

i get same error

Still stuck. I can’t get composer to update:

Short package list

$ composer require -W "mautic/core-lib":"^5.0"
./composer.json has been updated
Running composer update mautic/core-lib --with-all-dependencies
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 ^5.0, found mautic/core-lib[5.0.0-alpha, ..., 5.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 2
    - mautic/grapes-js-builder-bundle is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/grapes-js-builder-bundle 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 3
    - mautic/plugin-citrix is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-citrix 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 4
    - mautic/plugin-clearbit is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-clearbit 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 5
    - mautic/plugin-cloudstorage is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-cloudstorage 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 6
    - mautic/plugin-crm is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-crm 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 7
    - mautic/plugin-emailmarketing is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-emailmarketing 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 8
    - mautic/plugin-focus is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-focus 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 9
    - mautic/plugin-fullcontact is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-fullcontact 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 10
    - mautic/plugin-gmail is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-gmail 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 11
    - mautic/plugin-outlook is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-outlook 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 12
    - mautic/plugin-social is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-social 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 13
    - mautic/plugin-tagmanager is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-tagmanager 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 14
    - mautic/plugin-zapier is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/plugin-zapier 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 15
    - mautic/theme-aurora is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/theme-aurora 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).
  Problem 16
    - mautic/theme-[XYZ]
...
  Problem 35
    - mautic/theme-vibrant is locked to version 4.4.9 and an update of this package was not requested.
    - mautic/theme-vibrant 4.4.9 requires mautic/core-lib ^4.0 -> found mautic/core-lib[4.0.0-alpha1, ..., 4.x-dev] but it conflicts with your root composer.json require (^5.0).


Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Verbose package list

It even won’t update if I give it a verbose list of the packages:

$ composer require -W "mautic/core-lib": "^5.0" "mautic/grapes-js-builder-bundle": "^5.0" "mautic/plugin-clearbit": "^5.0" "mautic/plugin-cloudstorage": "^5.0" "mautic/plugin-crm": "^5.0" "mautic/plugin-emailmarketing": "^5.0" "mautic/plugin-focus": "^5.0" "mautic/plugin-fullcontact": "^5.0" "mautic/plugin-gmail": "^5.0" "mautic/plugin-tagmanager": "^5.0" "mautic/plugin-outlook": "^5.0" "mautic/plugin-social": "^5.0" "mautic/plugin-tagmanager": "^5.0" "mautic/plugin-zapier": "^5.0" "mautic/theme-aurora": "^5.0" "mautic/theme-blank": "^5.0" "mautic/theme-brienz": "^5.0" "mautic/theme-cards": "^5.0" "mautic/theme-coffee": "^5.0" "mautic/theme-confirmme": "^5.0" "mautic/theme-fresh-center": "^5.0" "mautic/theme-fresh-fixed": "^5.0" "mautic/theme-fresh-left": "^5.0" "mautic/theme-fresh-wide": "^5.0" "mautic/theme-goldstar": "^5.0" "mautic/theme-mauve": "^5.0" "mautic/theme-nature": "^5.0" "mautic/theme-neopolitan": "^5.0" "mautic/theme-oxygen": "^5.0" "mautic/theme-paprika": "^5.0" "mautic/theme-skyline": "^5.0" "mautic/theme-sparse": "^5.0" "mautic/theme-sunday": "^5.0" "mautic/theme-vibrant": "^5.0" "mautic/theme-trulypersonal": "^5.0"
./composer.json has been updated
Running composer update mautic/core-lib mautic/grapes-js-builder-bundle mautic/plugin-clearbit mautic/plugin-cloudstorage mautic/plugin-crm mautic/plugin-emailmarketing mautic/plugin-focus mautic/plugin-fullcontact mautic/plugin-gmail mautic/plugin-tagmanager mautic/plugin-outlook mautic/plugin-social mautic/plugin-zapier mautic/theme-aurora mautic/theme-blank mautic/theme-brienz mautic/theme-cards mautic/theme-coffee mautic/theme-confirmme mautic/theme-fresh-center mautic/theme-fresh-fixed mautic/theme-fresh-left mautic/theme-fresh-wide mautic/theme-goldstar mautic/theme-mauve mautic/theme-nature mautic/theme-neopolitan mautic/theme-oxygen mautic/theme-paprika mautic/theme-skyline mautic/theme-sparse mautic/theme-sunday mautic/theme-vibrant mautic/theme-trulypersonal --with-all-dependencies
Loading composer repositories with package information
Updating dependencies                                 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - mautic/core-lib[5.0.0-alpha, ..., 5.0.x-dev] require symfony/event-dispatcher ~5.4.0 -> found symfony/event-dispatcher[v5.4.0-BETA1, ..., 5.4.x-dev] but these were not loaded, likely because it conflicts with another require.
    - mautic/core-lib[5.1.x-dev, ..., 5.x-dev] require lightsaml/sp-bundle dev-symfony5 -> found lightsaml/sp-bundle[dev-master, 1.0.0-beta.1, ..., 1.2.1] but it does not match the constraint.
    - Root composer.json requires mautic/core-lib ^5.0 -> satisfiable by mautic/core-lib[5.0.0-alpha, ..., 5.x-dev].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require mautic/grapes-js-builder-bundle:*" to figure out if any version is installable, or "composer require mautic/grapes-js-builder-bundle:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

PS Manually removed the citrix plugin, before trying to update using the verbose package list.

@peter_k can you try following steps?
If they work, we will add them to the Mautic update docs.

  • create a backup of the composer.json file (or use your VCS system)
  • execute following commands to update the dependencies in your project.
# remove obsolete themes and plugins
composer remove mautic/theme-nature mautic/theme-mauve mautic/theme-coffee mautic/plugin-citrix

# replace the requirements of all mautic specified dependencies
sed -i -E 's/(    "mautic\/.*": ")4\.4\.10"/\1^5.0"/' composer.json

# update the overwritten repositories
composer config repositories.0 git https://github.com/mautic/FOSOAuthServerBundle.git
composer config repositories.1 git https://github.com/mautic/SpBundle.git
composer config repositories.2 git https://github.com/mautic/SymfonyBridgeBundle.git
  • review the changes in the composer.json and adjust if needed
  • run composer update --update-with-all-dependencies to run the update
1 Like

This happen to have worked for me

My error when Upgrade:

`composer update
Do not run Composer as root/super user! See How do I install untrusted packages safely? Is it safe to run Composer as superuser or root? - Composer for details
Continue as root/super user [yes]? y
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.3.1 → satisfiable by mautic/core-lib[4.3.1].
- mautic/core-lib 4.3.1 requires lightsaml/sp-bundle ~1.2.1 → satisfiable by lightsaml/sp-bundle[1.2.1] from composer repo (https://repo.packagist.org) but lightsaml/sp-bundle[dev-master, dev-symfony5] from vcs repo (git GitHub - mautic/SpBundle: SAML2 SP Symfony Bundle based on LightSAML) has higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo’s packages are not installable. See Repository priorities - Composer for details and assistance.
Problem 2
- mautic/core-lib 4.3.1 requires lightsaml/sp-bundle ~1.2.1 → satisfiable by lightsaml/sp-bundle[1.2.1] from composer repo (https://repo.packagist.org) but lightsaml/sp-bundle[dev-master, dev-symfony5] from vcs repo (git GitHub - mautic/SpBundle: SAML2 SP Symfony Bundle based on LightSAML) has higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo’s packages are not installable. See Repository priorities - Composer for details and assistance.
- mautic/theme-trulypersonal 4.3.1 requires mautic/core-lib ^4.0 → satisfiable by mautic/core-lib[4.3.1].
- Root composer.json requires mautic/theme-trulypersonal 4.3.1 → satisfiable by mautic/theme-trulypersonal[4.3.1].

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

Thanks four your reply. The missing repositories were the issue. I managed to update 3 v4.4(9|10) instances.

Here’s my update process:

composer config repositories.0 git https://github.com/mautic/FOSOAuthServerBundle.git
composer config repositories.1 git https://github.com/mautic/SpBundle.git
composer config repositories.2 git https://github.com/mautic/SymfonyBridgeBundle.git
composer remove mautic/plugin-citrix mautic/theme-nature mautic/theme-mauve mautic/theme-coffee
composer require --no-update "mautic/core-lib":"^5.0"
composer require --no-update "mautic/grapes-js-builder-bundle":"^5.0" "mautic/plugin-clearbit":"^5.0"  "mautic/plugin-cloudstorage":"^5.0"  "mautic/plugin-crm":"^5.0"  "mautic/plugin-emailmarketing":"^5.0"  "mautic/plugin-focus":"^5.0"  "mautic/plugin-fullcontact":"^5.0"  "mautic/plugin-gmail":"^5.0"  "mautic/plugin-tagmanager":"^5.0"  "mautic/plugin-outlook":"^5.0"  "mautic/plugin-social":"^5.0"  "mautic/plugin-tagmanager":"^5.0"  "mautic/plugin-zapier":"^5.0"
composer require --no-update "mautic/theme-aurora":"^5.0"  "mautic/theme-blank":"^5.0"  "mautic/theme-brienz":"^5.0"  "mautic/theme-cards":"^5.0" "mautic/theme-confirmme":"^5.0"  "mautic/theme-fresh-center":"^5.0"  "mautic/theme-fresh-fixed":"^5.0"  "mautic/theme-fresh-left":"^5.0"  "mautic/theme-fresh-wide":"^5.0"  "mautic/theme-goldstar":"^5.0"  "mautic/theme-neopolitan":"^5.0"  "mautic/theme-oxygen":"^5.0"  "mautic/theme-paprika":"^5.0"  "mautic/theme-skyline":"^5.0"  "mautic/theme-sparse":"^5.0"  "mautic/theme-sunday":"^5.0"  "mautic/theme-vibrant":"^5.0"  "mautic/theme-trulypersonal":"^5.0"
composer update --with-all-dependencies
php bin/console cache:clear
php bin/console mautic:update:apply --finish
php bin/console doctrine:migration:migrate --no-interaction
php bin/console cache:clear

Gotchas / Issues

  • Mautic deleted MTCDIR/docroot/app/config/local.php
    • I guess some script is supposed to move it from MTCDIR/docroot/app/config/local.php to MTCDIR/config/local.php, but this doesn’t happen.
    • Solution: back it up and add it before running mautic:update:apply --finish
  • The composer post-update scripts don’t get added.
    • Solution: Add this to your composer.json
  "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",
    "generate-assets": "php bin/console mautic:assets:generate"
  },
  • Run npm install afterwards

I expect, there could be/are still things missing—I just didn’t run into them, yet.

Thanks for your help!

@peter_k

thanks for your detailed steps, they make sense indeed.
I’ll work on a PR to get the combined info into the user docs

1 Like

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