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.

  • did you got any solution for this? – Piyush Aug 20 '18 at 13:15
  • Not yet. We are still doing what I mentioned on the last paragraph... – Pini Aug 21 '18 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 Aug 21 '18 at 23:34
  • 1
    PHP 7.0.30 & yes, we have Wyomind Cron Scheduler. – Pini Aug 22 '18 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 Aug 22 '18 at 12:24

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

| improve this answer | |

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

rm -rf var/cache/ generated/
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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