Magento 2.1.18 is the final 2.1.x release. After June 2019, Magento 2.1.x will no longer receive security patches, quality fixes, or documentation updates.
To maintain your site's performance, security, and PCI compliance, upgrade to the latest version of Magento.

Troubleshoot upgrade issues

Troubleshoot upgrade issues

This section discusses upgrade issues to Magento version 2.0.4. Symptoms include any of the following errors during the upgrade process:

Strict Notice exception

Error text follows:

1
2
[Exception]                                                                                                                                                
Strict Notice: Declaration of Magento\Store\Model\ResourceModel\Website\Interceptor::afterLoad() should be compatible with Magento\Framework\Model\ResourceModel\Db\AbstractDb::afterLoad(Magento\Framework\DataObject $object) in /var/www/html/magento2ce/var/generation/Magento/Store/Model/ResourceModel/Website/Interceptor.php on line 7   

PHP fatal error

A snippet from this error follows:

1
2
3
4
5
6
PHP Fatal error:  Cannot instantiate interface Magento\Framework\MessageQueue\ConfigInterface in /var/www/html/eddie/project-enterprise-edition/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73
PHP Stack trace:
PHP   1. {main}() /var/www/html/eddie/project-enterprise-edition/bin/magento:0
PHP   2. Magento\Framework\Console\Cli->__construct() /var/www/html/eddie/project-enterprise-edition/bin/magento:26
PHP   3. Symfony\Component\Console\Application->__construct() /var/www/html/eddie/project-enterprise-edition/vendor/magento/framework/Console/Cli.php:94
... more ...

Solution

To resolve these errors, perform the following tasks:

  1. Log in to your Magento server as, or switch to, the Magento file system owner.

    If you don’t have access to the Magento server file system, connect to it using an FTP application.

  2. Remove the following files so you can upgrade again:

    1
    2
    3
    4
    5
    
    <magento_root>/var/.maintenance.flag
    <magento_root>/var/.update_in_progress.flag
    <magento_root>/var/cache/*
    <magento_root>/var/page_cache/*
    <magento_root>/var/generation/*
    
  3. Run your upgrade again, making sure to complete all tasks discussed in Run System Upgrade.

var/session permissions failure

If your Magento application is set to write session data to the <magento_root>/var/session directory, you must set permissions on that directory before you upgrade.

How to find where Magento stores session files.

To verify whether or not sessions are stored in <magento_root>/var/session, log in to your Magento server, or switch to, Magento file system owner and enter the following command:

1
ls <your Magento file install dir>/var/session

For example, if Magento is installed in /var/www/magento2, enter:

1
ls /var/www/magento2/var/session

If there are files in that directory, you must set permissions; if there are no files in that directory, you can skip the remainder of this topic and continue with Step 4. Upgrade.

To set file system permissions before upgrade:

  1. Log in to your Magento server as, or switch to, the Magento file system owner.
  2. Enter one of the following commands:

    • One Magento user (typical of shared hosting):

      1
      2
      3
      
      cd <magento_root>
      find var -type f -exec chmod u+w {} +
      find var -type d -exec chmod u+w {} +
      

      If you don’t have access to a command line, use a file manager tool provided by your hosting provider to set permissions.

    • Two Magento users:

      1
      2
      3
      4
      
      cd <magento_root>
      find var -type f -exec chmod g+w {} +
      find var -type d -exec chmod g+ws {} +
      chown -R :<web server group> .
      

      For example, on CentOS where the web server group is typically apache:

      1
      2
      3
      4
      
      cd /var/www/html/magento2
      find var -type f -exec chmod g+w {} +
      find var -type d -exec chmod g+ws {} +
      chown -R :apache .
      

For additional details about file ownership and permissions, see Set pre-installation ownership and permissions.

Updated