Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis cache need Fix #10524

Closed
tomnyson opened this issue Aug 14, 2017 · 31 comments
Closed

Redis cache need Fix #10524

tomnyson opened this issue Aug 14, 2017 · 31 comments
Labels
bug report Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@tomnyson
Copy link

Preconditions

  1. magento 2.1.7 to 2.1.8 php7.0-fpm,mysql 5.7

Steps to reproduce

  1. composer require magento/product-community-edition 2.1.8--no-update
  2. composer update
  3. php bin/magento setup:upgrade

Expected result

  1. Cannot instantiate interface Magento\Framework\App\Config\ConfigSourceInterface in /home/dev/public_html/current/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73

Actual result

  1. [Screenshot, logs]
    image
@ngocdb
Copy link

ngocdb commented Aug 14, 2017

+1
Same problem here.

@ngocdb
Copy link

ngocdb commented Aug 14, 2017

Solved the issue. In my case it is because the Redis cache. Flush all the cache will solve the issue.

@tomnyson
Copy link
Author

can you tell me exactly step by step

@tomnyson
Copy link
Author

@ngocdb thank pro 👍 I solved issue

@denchev
Copy link
Contributor

denchev commented Aug 14, 2017

I also had this issue. Flushing the cache did not solve it as the console was giving me the same issue. But a second run composer update fixed it. I believe it has something to do with autoload files not being properly generated the first time.

@tomnyson
Copy link
Author

if I only use cache file everything ok.but If I use cache Redis cache so still the an error

@mdesplenter
Copy link

@denchev This helped for me, thank you.

@tomnyson
Copy link
Author

hey!! do you have redis cache

@gaiterjones
Copy link

gaiterjones commented Aug 15, 2017

I am seeing exactly the same error after upgrading from 2.1.7 to 2.1.8 with REDIS cache enabled.

Cannot instantiate interface Magento\Framework\App\Config\ConfigSourceInterface

If I disable redis by removing the redis config from env.php Magento starts normally. If I enable redis again the error is shown.

@tomnyson
Copy link
Author

me too.I guess the issue of Magento 2.1.8

@tomnyson tomnyson changed the title upgrade 2.1.7 to 2.1.8 Redis cache need Fix Aug 15, 2017
@gaiterjones
Copy link

Are you in development mode?

If so this resolved it for me

  1. remove redis default (system) config from env.php
  2. switch to production mode
  3. after compilation add redis config back into env.php
  4. flush caches
  5. switch back to development

@tomnyson
Copy link
Author

thank you !!

@mugua
Copy link

mugua commented Aug 17, 2017

Just updated the Credis module to 1.8.2 can solved this issue in M2.1.8.

https://github.com/colinmollenhour/credis/archive/1.8.2.tar.gz

@tomnyson
Copy link
Author

@mugua can you tell me.How to can apply your code to my project.

@BenSpace48
Copy link
Contributor

Running php bin/magento setup:upgrade resolved this for me.

@mugua
Copy link

mugua commented Aug 21, 2017

@tomnyson
1: update composer.json & composer.lock (credis module) to the lastest version.
2: php bin/magento setup:upgrade

@IlnitskiyArtem
Copy link

Hi @tomnyson. Cannot reproduce your issue on clean instance. May be you have some additional modules or specific store configurations? Please, provide more details to identify your issue.

@royvanos
Copy link

I've had the same issue when upgrading from 2.1.7 to 2.1.8, it took me an hour to figure this out, flushing the redis cache worked!

@IlnitskiyArtem
Copy link

Hi @tomnyson. Internal ticket MAGETWO-72383 created.

@maderlock
Copy link

maderlock commented Sep 11, 2017

The only thing that worked for me was disabling redis in env.php. I cannot update to a more recent version of credis due to the meta-package specifying the version for me :(

If this is the solution, how can redis be updated to the latest version if magento/product-community-edition requires 1.6? Does that mean that we have to move away from using the meta package if we want to use redis?

This is a little concerning as we had promised to upgrade a live site to 2.1.8 but that relies on redis for caching.

@magento-engcom-team magento-engcom-team added bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Sep 11, 2017
@maderlock
Copy link

maderlock commented Sep 15, 2017

Here's a solution if you use the meta-package:

  1. Download Credis 1.8.2 to somewhere like app/code/Credis/
  2. Add the following sections into your composer.json to tell composer not to bother pulling in credis, and handle the class mapping:
    "replace": {
        "colinmollenhour/credis": "*"
    }

and also the following as part of the "autoload" section as credis is not psr-0 compliant:

    "autoload": {
        ...
        "classmap": [
            "app/code/Credis/Client.php",
            "app/code/Credis/Cluster.php",
            "app/code/Credis/Sentinel.php",
            "app/code/Credis/Module.php"
        ]
    }

@maderlock
Copy link

Having made my change above, I'm getting an intermittent error:

"a:4:{i:0;s:24:"read error on connection";i:1;s:3327:"#0 .../web-root/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php(397): Credis_Client->__call('exec', Array)
#1 .../web-root/vendor/magento/zendframework1/library/Zend/Cache/Core.php(390): Cm_Cache_Backend_Redis->save('a:5:{i:0;a:1206...', 'dca_DICONFIG07A...', Array, NULL)"
...

I am not getting this on my <2.1.8 sites on the same server, so redis has not gone away.

It's possible that just swapping in Credis 1.8.2 is not enough to fix this issue, or there may be a second issue.

@maderlock
Copy link

This is a serious issue for 2.1.x. I assume that if this is fixed for 2.2 it will be ported back to 2.1, or you're going to leave 2.1 in a seriously broken state - not being able to use Redis at all is a major problem for us and we're considering going back to 2.1.7 as 2.2 is too big a change at the moment.

@magento-engcom-team
Copy link
Contributor

The issue should be fixed in #11222

@magento-engcom-team
Copy link
Contributor

@tomnyson, thank you for your report.
The issue is already fixed in 2.1.9

@magento-engcom-team magento-engcom-team added 2.1.x Fixed in 2.1.x The issue has been fixed in 2.1 release line Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Oct 11, 2017
@maderlock
Copy link

@magento-engcom-team could you please explain in what way this is fixed for 2.1.9 as colinmollenhour/credis is still set at v1.6 which is part of the problem. When exactly was this fixed and why can't I see it?

@maderlock
Copy link

maderlock commented Oct 13, 2017

I have to admit that my work-around no longer works.

In theory you also need to download the src/ folder of https://github.com/colinmollenhour/php-redis-session-abstract to your code folder. And add the following to your replace section of composer.json:

"colinmollenhour/php-redis-session-abstract": "*"

This is in addition to the changes above.

HOWEVER, when compiling you get this error:

HP Fatal error: Class Magento\Framework\Session\SaveHandler\Redis\Config contains 5 abstract methods and must therefore be declared abstract or implement the remaining methods (Cm\RedisSession\Handler\ConfigInterface::getFailAfter, Cm\RedisSession\Handler\ConfigInterface::getSentinelServers, Cm\RedisSession\Handler\ConfigInterface::getSentinelMaster, ...) in /var/www/vhosts/sanddollardubai.com/deploy/release-candidate/vendor/magento/framework/Session/SaveHandler/Redis/Config.php on line 16

@ishakhsuvarov ishakhsuvarov reopened this Oct 13, 2017
@ishakhsuvarov
Copy link
Contributor

ishakhsuvarov commented Oct 13, 2017

Issue reopened for further investigation. Inappropriate comments removed.
Please provide clear steps to reproduce, initial description does not have any information regarding redis.

@magento magento deleted a comment from maderlock Oct 13, 2017
@ishakhsuvarov ishakhsuvarov removed the Fixed in 2.1.x The issue has been fixed in 2.1 release line label Oct 13, 2017
@maderlock
Copy link

Apologies for shouting. I'll reproduce and update here.

@maderlock
Copy link

To my shame, having removed all my workarounds I now cannot find any issue to report. This is especially embarrassing given my desperate earlier messages. Something must have been fixed in 2.1.9 but I assumed that as the versions of redis and libraries had not updated that there was still an issue. I'll go and eat some humble pie now. Please close this.

@ishakhsuvarov
Copy link
Contributor

@maderlock Thank you for the update. Closing this issue now per your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests