sezzle / sezzle-magento2

Apache License 2.0
5 stars 3 forks source link

Cron Job failures after installing Sezzle #29

Open lbajsarowicz opened 4 weeks ago

lbajsarowicz commented 4 weeks ago

After installing and setting up your extension in Magento 2, we started to encounter significant issues with Cron Job reliability:

image

A brief investigation shows that the problem is caused by Log synchronization. Although we disabled log sync, the problem still occurs.

There's problem with resource handling:

image

This must be somehow related to the following error:

$ n98-magerun sys:cron:run sezzle_sync_logs

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Payment\Gateway\Http\TransferFactoryInterface in /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Payment...')
#1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Payment...')
#2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Payment...', NULL, 'transferFactory', 'Sezzle\\Sezzlepa...')
#3 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Sezzle\\Sezzlepa...', Array, Array)
#4 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Sezzle\\Sezzlepa...', Array, Array)
#5 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Sezzle\\Sezzlepa...', Array, Array)
#6 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Sezzle\\Sezzlepa...')
#7 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(170): Magento\Framework\ObjectManager\ObjectManager->get('Sezzle\\Sezzlepa...')
#8 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(276): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Sezzle\\Sezzlepa...', NULL, 'v1', 'Sezzle\\Sezzlepa...')
#9 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(239): Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Sezzle\\Sezzlepa...', Array, Array)
#10 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Sezzle\\Sezzlepa...', Array, Array)
#11 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(59): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Sezzle\\Sezzlepa...', Array, Array)
#12 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Sezzle\\Sezzlepa...')
#13 phar:///usr/local/bin/n98-magerun/src/N98/Magento/Command/System/Cron/AbstractCronCommand.php(260): Magento\Framework\ObjectManager\ObjectManager->get('Sezzle\\Sezzlepa...')
#14 phar:///usr/local/bin/n98-magerun/src/N98/Magento/Command/System/Cron/RunCommand.php(52): N98\Magento\Command\System\Cron\AbstractCronCommand->getJobForExecuteMethod(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 phar:///usr/local/bin/n98-magerun/vendor/symfony/console/Command/Command.php(298): N98\Magento\Command\System\Cron\RunCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 phar:///usr/local/bin/n98-magerun/src/N98/Magento/Command/AbstractMagentoCommand.php(249): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 phar:///usr/local/bin/n98-magerun/vendor/symfony/console/Application.php(1058): N98\Magento\Command\AbstractMagentoCommand->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 phar:///usr/local/bin/n98-magerun/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(N98\Magento\Command\System\Cron\RunCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 phar:///usr/local/bin/n98-magerun/src/N98/Magento/Application.php(256): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 phar:///usr/local/bin/n98-magerun/vendor/symfony/console/Application.php(171): N98\Magento\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 phar:///usr/local/bin/n98-magerun/src/N98/Magento/Application.php(364): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /usr/local/bin/n98-magerun(8): N98\Magento\Application->run()
#23 {main}
  thrown in /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50
`

When I execute n98-magerun2 sys:cron:run sezzle_sync_logs

I'm looking further.

lbajsarowicz commented 4 weeks ago

Solution Add missing declaration for transferFactory.

diff --git a/etc/di.xml b/etc/di.xml
--- a/etc/di.xml    
+++ b/etc/di.xml    (date 1729853520343)
@@ -306,5 +306,9 @@
         </arguments>
     </virtualType>

-
+    <type name="Sezzle\Sezzlepay\Model\Api\V1">
+        <arguments>
+            <argument name="transferFactory" xsi:type="object">Sezzle\Sezzlepay\Gateway\Http\TransferFactory</argument>
+        </arguments>
+    </type>
 </config>

I wish you were more thorough with testing, as this really affects businesses you work with.

arijit-sezzle commented 4 weeks ago

Sorry for that. We are aware of that issue and that's in progress and going to go in the next release.