Mautic Community Forums

Impossible to update from 2.16.0

Your software
My Mautic version is: 2.16.0
My PHP version is: Irrelevant

Your problem
My problem is: I cannot update to Mautic 2.16.2 nor to 2.16.1.

The error is always the same:

Type error: Argument 1 passed to Mautic\CoreBundle\Helper\LanguageHelper::__construct() must be an instance of Mautic\CoreBundle\Helper\PathsHelper, instance of Mautic\C
oreBundle\Factory\MauticFactory given, called in /var/www/[redacted]/public_html/app/cache/prod/appProdProjectContainer.php on line 11412

Steps I have tried to fix the problem:

The first time the error appeared was migrating from 2.16.0 > 2.16.2.

Then I restored a snapshot taken before starting trying to upgrade and tried again to upgrade to version 2.16.1

 php public_html/app/console mautic:update:apply

The same error happened.

How can I migrate to a new version of Mautic? Any ideas?

Hi there,

Please always share the information requested in the post template - we would not ask for it if it were irrelevant :slight_smile:

Have you cleared the cache? Was it successfully cleared? If not, what were the errors?

This line in the error above is referring to something in the cache directory:

called in /var/www/ [redacted] /public_html/app/cache/prod/appProdProjectContainer.php on line 11412

Adding the Github issue you raised so that they are connected and to avoid duplication:

1 Like

Thank you for your reply :slight_smile:

I know very well PHP and Symfony and the version I’m running is not relevant.

Anyway it is PHP7.

I did a lot of tests…

I will update both the post and the issue with all the details.

I cleared the cache, before and after, I tried to update the schema (strange behavior: it wanted to remove some indexes and add them again, also if the schema tool of Mautic reports there are nothing to update).

I did all from the command line, but didn’t had the time to dig in the problem…

Now I found another way: test to manually update the files…

I will update the posts with all the details.

I wrote the post thinking that someone else had already faced the issue, but I think I’m the first one, so I have to solve it on my own :scream:

I know very well PHP and Symfony and the version I’m running is not relevant.

I don’t doubt it, however please be respectful of those who may try to support you by reproducing the issue with the same environment, or come to threads later to see if it matches their situation. It takes a second to add if you already know what you are doing, so there is no reason not to follow the requested steps.

Looking forward to reading the follow up.

1 Like

My PHP version is 7.2, if you need to know it.

Please, reopen the issue on GitHub: mine is a problem related to upgrading, not about a general feature.

If the upgrade path is broken (as it is), this is not something that should fall in the general rules about support.

@aerendir I can reproduce this error. The LanguageHelper in the error message triggered me to set Mautic to a different language than the default (default is English US if I remember correctly). That indeed triggers the error.

When I set the Mautic language to its default (English US) the update succeeds without issues:

denni@mautic2160-web:/var/www/html$ app/console mautic:update:apply
Are you sure you wish to update Mautic to the latest version? y
Step    7 [============================] Success! You are now running version 2.16.3 of Mautic.

Can you confirm if that solves the error for you as well? If it does, I’ll check if this bug is still present in Mautic 3 and so if we need to re-open your GitHub issue. :slight_smile:

1 Like

I think I didn’t changed the default language…

Anyway I’ll investigate further and update you.

Thank you for your hint!