Errors upgrading 2.15.3 -> 2.16.2, re-run more successful

Your software
My Mautic version was: 2.15.3, will be 2.16.1
My PHP version is: 7.3.14

Your problem
My problem is: upgrade fails:

# php /var/www/ems/app/console mautic:update:apply --update-package=/tmp/2.16.2-update.zip  
Are you sure you wish to update Mautic to the latest version? yes
Step    5 [----->----------------------] mautic.core.command.update.step.update_languages                   
                                                                                                                                                             
 [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, inst   
 ance of Mautic\CoreBundle\Factory\MauticFactory given, called in /var/www/ems/app/cache/prod/appProdProjectContainer.php on line 11285                      
                                                                                                                                                             

mautic:update:apply [--force] [-p|--update-package [UPDATE-PACKAGE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--
no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command>

These errors are showing in the log:

[2020-05-06 14:05:26] mautic.WARNING: PHP Warning - require(/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php): failed
to open stream: No such file or directory - in file /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 {"cl
assName":"Mautic\\PluginBundle\\Entity\\Plugin","classMetadata":"[object] (Doctrine\\ORM\\Mapping\\ClassMetadata: Doctrine\\ORM\\Mapping\\ClassMetadataInfo@00
0000006c6320f000000000122de0a2)","proxyClassName":"Proxies\\__CG__\\Mautic\\PluginBundle\\Entity\\Plugin","fileName":"/var/www/ems/app/cache/prod/doctrine/orm
/Proxies/__CG__MauticPluginBundleEntityPlugin.php"} []
[2020-05-06 14:05:26] mautic.ERROR: PHP Notice: require(): Failed opening required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleE
ntityPlugin.php' (include_path='.:/usr/share/php') - in file /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line
209 [] []
[2020-05-06 14:05:26] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/var/www/ems/app/cache/
prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (include_path='.:/usr/share/php') - in file /var/www/ems/vendor/doctrine/common/lib/Doctri
ne/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []
[2020-05-06 14:05:26] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening
required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (include_path='.:/usr/share/php')" at /var/www/ems/vendo
r/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 209 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorExceptio
n(code: 0): Compile Error: require(): Failed opening required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (inc
lude_path='.:/usr/share/php') at /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209)"} []
[2020-05-06 14:05:28] mautic.WARNING: PHP Warning - require(/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php): failed
to open stream: No such file or directory - in file /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 {"cl
assName":"Mautic\\PluginBundle\\Entity\\Plugin","classMetadata":"[object] (Doctrine\\ORM\\Mapping\\ClassMetadata: Doctrine\\ORM\\Mapping\\ClassMetadataInfo@00
00000079434360000000006edc3a11)","proxyClassName":"Proxies\\__CG__\\Mautic\\PluginBundle\\Entity\\Plugin","fileName":"/var/www/ems/app/cache/prod/doctrine/orm
/Proxies/__CG__MauticPluginBundleEntityPlugin.php"} []
[2020-05-06 14:05:28] mautic.ERROR: PHP Notice: require(): Failed opening required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleE
ntityPlugin.php' (include_path='.:/usr/share/php') - in file /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line
209 [] []
[2020-05-06 14:05:28] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/var/www/ems/app/cache/
prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (include_path='.:/usr/share/php') - in file /var/www/ems/vendor/doctrine/common/lib/Doctri
ne/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []
[2020-05-06 14:05:28] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening
required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (include_path='.:/usr/share/php')" at /var/www/ems/vendo
r/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 209 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorExceptio
n(code: 0): Compile Error: require(): Failed opening required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (inc
lude_path='.:/usr/share/php') at /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209)"} []
[2020-05-06 14:05:36] mautic.WARNING: PHP Warning - require(/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php): failed
to open stream: No such file or directory - in file /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 {"cl
assName":"Mautic\\PluginBundle\\Entity\\Plugin","classMetadata":"[object] (Doctrine\\ORM\\Mapping\\ClassMetadata: Doctrine\\ORM\\Mapping\\ClassMetadataInfo@00
0000001a7ab35a0000000022cf88d7)","proxyClassName":"Proxies\\__CG__\\Mautic\\PluginBundle\\Entity\\Plugin","fileName":"/var/www/ems/app/cache/prod/doctrine/orm
/Proxies/__CG__MauticPluginBundleEntityPlugin.php"} []
[2020-05-06 14:05:36] mautic.ERROR: PHP Notice: require(): Failed opening required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleE
ntityPlugin.php' (include_path='.:/usr/share/php') - in file /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line
209 [] []
[2020-05-06 14:05:36] mautic.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Notice: require(): Failed opening required '/var/www/ems/app/cache/
prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (include_path='.:/usr/share/php') - in file /var/www/ems/vendor/doctrine/common/lib/Doctri
ne/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []
[2020-05-06 14:05:36] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException: "Compile Error: require(): Failed opening
required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (include_path='.:/usr/share/php')" at /var/www/ems/vendo
r/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php line 209 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorExceptio
n(code: 0): Compile Error: require(): Failed opening required '/var/www/ems/app/cache/prod/doctrine/orm/Proxies/__CG__MauticPluginBundleEntityPlugin.php' (inc
lude_path='.:/usr/share/php') at /var/www/ems/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php:209)"} []

Steps I have tried to fix the problem:

  • Checked the “can’t open” file is present: it is.

  • Re-ran upgrade. Much better results:

      # php /var/www/ems/app/console mautic:update:apply --update-package=/tmp/2.16.2-update.zip 
      Are you sure you wish to update Mautic to the latest version? yes
      Step    5 [----->----------------------] mautic.core.command.update.step.update_languages                  PHP Warning:  file_put_contents(/var/www/ems/app/cache/prod/en_GB.zip): failed to open stream: No such file or directory in /var/www/ems/app/bundles/CoreBundle/Helper/LanguageHelper.php on line 298
    
    
      Could not update the 'English (United Kingdom)' language.
      Step    7 [============================] Success! You are now running version 2.16.2-update.zip of Mautic.
      #
    

I don’t know why it couldn’t create the en_GV.zip file; the parent directory exists

# ls -l /var/www/ems/app/cache/prod/ -d drwxr-xr-x 5 www-data www-data 4096 May 6 14:15 /var/www/ems/app/cache/prod/

Let me know if you need any more info.

Did you solved in the end?

I have a similar problem a found your 3D through Google.

I didn’t had the time to dig in logs, but reading yours, did you checked the permissions of files?

As the file is there, but PHP cannot access it, the problem may be this.

Here is my post

My note isn’t clear, sorry. Re-running the update was essentially successful. It was some time ago now so I can’t remember whether I had to do anything more than re-run it, sorry.

2 Likes