1

Since we upgraded Magento to 2.2.5, after every deployment to production (which includes git pull..., composer update & all other relevant Magento CLI commands for production deployment), our indexers stops to work & when we check the cron by running php bin/magento cron:run we get this error:

PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Lock\LockManagerInterface in /.../vendor/magento/framework/ObjectManager/Factory/AbstractFactory

The only way we found that seems to solve this (temporarily) is to clear the composer cache, remove the vendor dir, running composer update again & re-deploying Magento again.
We have to do that every time, after every deployment & it's really annoying.

7
  • did you got any solution for this?
    – Piyush
    Commented Aug 20, 2018 at 13:15
  • Not yet. We are still doing what I mentioned on the last paragraph...
    – Pini
    Commented Aug 21, 2018 at 6:47
  • Having the same issue... Your workaround does not work for us. What version of PHP are you using? Have you seen: github.com/magento/magento2/issues/16793 Do you have Wyomind Cron Scheduler in your build?
    – Flipmedia
    Commented Aug 21, 2018 at 23:34
  • 1
    PHP 7.0.30 & yes, we have Wyomind Cron Scheduler.
    – Pini
    Commented Aug 22, 2018 at 5:41
  • I've spent time removing Wyomind Cron Scheduler and in fact all Wyomind extension. I still have the error... I have also disabled all third party extensions, error still persists.
    – Flipmedia
    Commented Aug 22, 2018 at 12:24

2 Answers 2

2

Your di.xml is stale / not upgraded correctly, see the below grep result, if you do not get this result from you di.xml file is the issue.

$grep Lock app/etc/di.xml 
<preference for="Magento\Framework\Lock\LockManagerInterface" type="Magento\Framework\Lock\Backend\Database" />

In our case I found that our deployment script was excluding di.xml from being rolled out to production. I removed this exclusion and redeployed to correct the issue.

You may find that permissions / user / group allocated to di.xml stopped the file being updated...

See solution here with correct di.xml supplied: https://github.com/magento/magento2/issues/16793#issuecomment-418334379

1

Try clearing your cache, and generated files, and then retry running your commands.

rm -rf var/cache/ generated/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.