Magento2: Cannot instantiate interface Magento\Framework\Cache\FrontendInterface

Created on 22 Dec 2016  路  14Comments  路  Source: magento/magento2

Preconditions

Magento 2.0.7

Steps to reproduce

  1. I upgraded magento 2.0.7 to version 2.1.3

Expected result

  1. Upgraded successfully

Actual result

  1. When I try to edit any product I got "Fatal error: Cannot instantiate interface Magento\Framework\Cache\FrontendInterface in /home/storekpiin/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93"
Cannot Reproduce Clear Description Format is valid bug report

Most helpful comment

Try replacing app/etc/di.xml with the default M2.3.3 one.

All 14 comments

@claudiumitreaa thank you for your report.
I was not able to reproduce this issue.
Could you please provide more information?

  • Exact steps you did during upgrade.
  • What exactly do you edit?
  • Do you have any 3rd party extensions?
  • Please also provide information about your environment: OS, versions of PHP, MySQL and web-server.

Hey,thanks for your support!

  1. Steps to upgrade
    composer require magento/product-community-edition 2.1.3 --no-update
    composer update
    rm -rf var/di var/generation
    php bin/magento cache:clean
    php bin/magento cache:flush
    php bin/magento setup:upgrade (When I ran this command I got
    [Zend_Db_Statement_Exception]
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-Images' for key 'EAV_ATTRIBUTE_GROUP_ATTRI
    BUTE_SET_ID_ATTRIBUTE_GROUP_NAME', query was: UPDATE eav_attribute_group SET attribute_group_name = ? WHERE (a ttribute_group_id=10) ;
    After I deleted 4-Images rows from db, I was able to continue the upgrade
    )
    php bin/magento setup:di:compile
    php bin/magento indexer:reindex
  2. Products
    1
    When I click edit button,I got "Fatal error: Cannot instantiate interface Magento\Framework\Cache\FrontendInterface in /home/storekpiin/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93"
  3. Yes, I will enumerate them:

    • Itoris_DynamicProductOptions (this module is related to products and let you to configure them)

    • Cryozonic (payment module)

    • Smartwave (theme module)

    • KPIs (generate reports)

  4. Information about environment:

    • OS

      2

  5. PHP Version 5.6.22
  6. MySQL
    3

@claudiumitreaa, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.1.9

I am betting this is redis cache. Sometimes you have to clear it manually. I just ran into this and manually clearing redis fixed it.

echo flushall | redis-cli

^ Depends on your redis config of course. That is the command I ran to clear it with redis local on port 6379.

You can clear with plain telnet also:

telnet localhost 6379
flushall
]
quit

I am betting this is redis cache. Sometimes you have to clear it manually. I just ran into this and manually clearing redis fixed it.

echo flushall | redis-cli

^ Depends on your redis config of course. That is the command I ran to clear it with redis local on port 6379.

You can clear with plain telnet also:

telnet localhost 6379
flushall
]
quit

redis-cli flushall worked for me.

I am getting this issue on localhost, no redis is configured. Its simple filesystem caching. Any idea?
Version: 2.3.1

I am also getting this issue while trying to update from 2.2.7 to 2.3.1. Any insight would be much appreciated.

I managed to solve the problem after comparing my root composer.json file to a new Magento 2.3.1 project. I made sure I had the following:

"autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        ...
}

The last item was missing from the project I was updating. After adding it, I was able to run bin/magento again.

I still have the same issue. Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Cache\FrontendInterface in E:\wamp64\www\update\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php:50 Stack trace: #0

Most probably its because of missing classes or changes in the setup/ folder.

Make sure you have "magento-force": "override" in your composer.json extra section and try:

$ rm -rf setup/
$ rm -rf vendor/magento/magento2-base/
$ composer install

I have got the same error message after updating to 2.3.3.
Tried every solotion but noting solved my problem.

Did someone manage to solve the issue for people without redis?

Try replacing app/etc/di.xml with the default M2.3.3 one.

The following worked for me:

  • Edit your index.php put this at the start of the file die('maintenance'); to stop requests hitting the box and breaking things. (this can happen even if you are in maintenance mode)
  • edit app/etc/env.php make sure:

    1. deploy mode set to developer

    2. caches all set to 0

  • make sure your composer.json extra contains "magento-force": "override"
  • then run the following:
    bash echo "flushall" | redis-cli \ && mkdir vendor_backup \ && mv vendor/magento vendor_backup/ \ && composer install --no-dev \ && rm -rf generated/* \ && php bin/magento setup:upgrade \ && php bin/magento deploy:mode:set production \ && php bin/magento cache:enable \ && php bin/magento cache:flush
  • remove the amends to index.php

site should be alive again
hope this helps someone

Was this page helpful?
0 / 5 - 0 ratings