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:
[Symfony\Component\Debug\Exception\FatalThrowableError]
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
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
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.
@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.
Hello there,
I have got the same error on my side, on Ubuntu Server 18.04 running with PHP 7.2. I tried to update from version 2.15.3 to 2.16.3.
I switched the language to English US, deleted the cache, switched also the language in my profile (account), deleted the cache again.
Then I typed:
app/console cache:clear
app/console mautic:update:find
It tells me the 2.16.3 version is available, but running app/console mautic:update:apply leads me to the error:
“[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: Argument 1 passed to Mautic\CoreBundle\Helper\LanguageHelper::__construct() must be an instance of Mautic\CoreBundle\Helper\PathsHelper, instance of Mauti
c\CoreBundle\Factory\MauticFactory given, called in /var/www/html/mautic/app/cache/prod/appProdProjectContainer.php on line 11318”
I don’t feel like moving forward to Mautic 3 since I’m not sure it has been totally and successfuly updated. @aerendir did you find a solution finally?
Thank you.
I’ve tried to change the language to the default one “English US”, both in general Mautic’s setting and also in my own profile, but the error persists…
Ok, I finally was able to update from 2.16.0 to 2.16.1!
After a lot of debugging, I finally I guessed the problem was not a configuration issue but a filesystem issue: it was so strange that the container passed a wrong object to Mautic\CoreBundle\Helper\LanguageHelper::__construct().
I completely removed all the files from the current installation: they were corrupted or not correct anyway (maybe due to a past update not correctly applied)
I extracted the files from 2.16.0.zip and then uploaded them in place of the old ones
Uploaded again the file app/config/local.php
Ensured files and folders permissions and owners were the right ones:
cd /var/www/my/mautic/installation/public_html
find ./ -type d -exec chmod 755 {} \;
find ./ -type d -exec chown www-data {} \;
find ./ -type f -exec chmod 644 {} \;
find ./ -type f -exec chown www-data {} \;
Are you sure you wish to update Mautic to the latest version? y
Step 6 [============================] Success! You are now running version 2.16.1-update.zip of Mautic.
As final steps, and to prevent those kind of errors to happen again, I’m going to set again files and folders permissions, just to be sure that the next update will run smoothly!
Thanks for sharing your solution @aerendir! Just wanted to chime in here to say that we had the same issue yesterday on Ubuntu 16.04 (PHP 7.0) while trying to update a 2.14.0 instance to 2.16.5. The LanguageHelper issue popped up. This is what worked for us:
Start the upgrade
Hit the LanguageHelper error
Run the following commands (in the root of your Mautic installation directory):