taxjar / taxjar-magento2-extension

Magento 2 Sales Tax Extension by TaxJar
http://www.taxjar.com/guides/integrations/magento2/
Open Software License 3.0
22 stars 30 forks source link

PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Filesystem\DriverInterface in /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50 #297

Closed nickpiro closed 2 years ago

nickpiro commented 2 years ago

Error after upgrading to 2.3.7. Causes category pages to break and products unable to be added to cart. Error also stops any commands in CLI from running.

TaxJar 1.9.2

Description

Steps to Reproduce

  1. Upgrade from 2.3.6 to 2.3.7
  2. Run setup:upgrade

Expected Result

Complete setup:upgrade

Actual Result

PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Filesystem\DriverInterface in /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50 Stack trace:

0 /vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')

1 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')

2 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'fileDriver', 'Taxjar\SalesTax...')

3 /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): in /vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

Versions

Magento 2.3.7

Magento Open Source (CE)

PHP 7.3

sethobey commented 2 years ago

Hello @nickpiro,

This issue was reported here: https://github.com/taxjar/taxjar-magento2-extension/issues/247 and should be resolved here: https://github.com/taxjar/taxjar-magento2-extension/pull/241

Are you able to verify that the etc/di.xml file in your taxjar/module-taxjar installation contains a preference Magento\Framework\Filesystem\Driver\File for argument fileDriver? If so, please let me know if running the command bin/magento setup:di:compile resolves this issue for you.

nickpiro commented 2 years ago

That file does seem to be modified, correct. This is what I get when I compile:

Compilation was started. Repositories code generation... 1/8 [===>------------------------] 12% < 1 sec 77.0 MiBPHP Fatal error: Uncaught Error: Class 'Taxjar\SalesTax\Block\Adminhtml\PopupField' not found in /app/code/Taxjar/Salestax/Block/Adminhtml/Enabled.php:27 Stack trace:

0 /setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(135): require_once()

1 /setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClasses(Array, '..')

2 /setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(88): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract(Object(RecursiveIteratorIterator))

3 /setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList('/chroot/home/ma...')

4 in /app/code/Taxjar/Salestax/Block/Adminhtml/Enabled.php on line 27

sethobey commented 2 years ago

@nickpiro - If the TaxJar files are in place as it appears based on the stack trace you've included, this error may indicate a file permissions issue. Are you able to verify the server or VM filesystem group and permissions? Sometimes those things can get mucked up when copying files via FTP or mounting/copying filesystems to Docker containers.

Also, if you are able to attempt it, do you observe the same installation or compilation errors when installing our extension via composer?

sethobey commented 2 years ago

@nickpiro I'm closing this issue for now. Please feel free to re-open this issue or reach out to TaxJar support if you continue to experience the described error.