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

Cronjob notification error #366

Closed
dev-awevo opened this issue Dec 24, 2018 · 7 comments
Closed

Cronjob notification error #366

dev-awevo opened this issue Dec 24, 2018 · 7 comments
Assignees

Comments

@dev-awevo
Copy link

Magento version: 2.2.7
Plugin version: 2.4.3
Description
Hello,
I have a problem when i try to place order.
When the order is placed, after cron run, i have this error in cronjob.log of dir adyen

[2018-12-24 11:24:03] AdyenLoggerTest.ADYEN_NOTIFICATION_CRONJOB: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2_animalis.amazon_sales_order' doesn't exist, query was: SELECT main_table.*, extension_attribute_amazon_order_reference_id.amazon_order_reference_idASextension_attribute_amazon_order_reference_id_amazon_order_reference_idFROMsales_orderASmain_tableLEFT JOINamazon_sales_orderASextension_attribute_amazon_order_reference_id ON main_table.entity_id = extension_attribute_amazon_order_reference_id.order_id WHERE ((increment_id= '000000115')) #0 .../vendor/magento/framework/DB/Statement/Pdo/Mysql.php(93): Zend_Db_Statement_Pdo->_execute(Array) #1 .../vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array) #2 .../vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array) #3 .../vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECTmain_ta...', Array)
#4 .../vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(533): Zend_Db_Adapter_Pdo_Abstract->query('SELECT main_ta...', Array) #5 .../vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(605): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('SELECT main_ta...', Array)
#6 .../vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Select), Array)
#7 .../vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php(21): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\Framework\DB\Select), Array)
#8 .../vendor/magento/framework/Data/Collection/AbstractDb.php(774): Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll(Object(Magento\Framework\DB\Select), Array)
#9 .../vendor/magento/framework/Data/Collection/AbstractDb.php(670): Magento\Framework\Data\Collection\AbstractDb->_fetchAll(Object(Magento\Framework\DB\Select))
#10 .../vendor/magento/framework/Data/Collection/AbstractDb.php(574): Magento\Framework\Data\Collection\AbstractDb->getData()
#11 .../vendor/magento/framework/Data/Collection/AbstractDb.php(559): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)
#12 .../vendor/magento/framework/Data/Collection.php(331): Magento\Framework\Data\Collection\AbstractDb->load()
#13 .../vendor/magento/module-sales/Model/OrderRepository.php(127): Magento\Framework\Data\Collection->getItems()
#14 .../vendor/magento/framework/Interception/Interceptor.php(58): Magento\Sales\Model\OrderRepository->getList(Object(Magento\Framework\Api\SearchCriteria))
#15 .../vendor/magento/framework/Interception/Interceptor.php(138): Magento\Sales\Model\OrderRepository\Interceptor->___callParent('getList', Array)
#16 .../vendor/magento/framework/Interception/Interceptor.php(153): Magento\Sales\Model\OrderRepository\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\Api\SearchCriteria))
#17 .../generated/code/Magento/Sales/Model/OrderRepository/Interceptor.php(39): Magento\Sales\Model\OrderRepository\Interceptor->___callPlugins('getList', Array, Array)
#18 .../vendor/adyen/module-payment/Model/Cron.php(343): Magento\Sales\Model\OrderRepository\Interceptor->getList(Object(Magento\Framework\Api\SearchCriteria))
#19 .../vendor/adyen/module-payment/Model/Cron.php(281): Adyen\Payment\Model\Cron->execute()
#20 [internal function]: Adyen\Payment\Model\Cron->processNotification(Object(Magento\Cron\Model\Schedule))
#21 .../vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php(314): call_user_func_array(Array, Array)
#22 .../vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php(720): Magento\Cron\Observer\ProcessCronQueueObserver->_runJob(1545650640, 1545650643, Array, Object(Magento\Cron\Model\Schedule), 'adyen_payment')
#23 .../vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php(240): Magento\Cron\Observer\ProcessCronQueueObserver->processPendingJobs('adyen_payment', Array, 1545650643)
#24 .../vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php(269): Magento\Cron\Observer\ProcessCronQueueObserver->Magento\Cron\Observer{closure}('adyen_payment')
#25 .../vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php(241): Magento\Cron\Observer\ProcessCronQueueObserver->lockGroup('adyen_payment', Object(Closure))
#26 .../vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Magento\Cron\Observer\ProcessCronQueueObserver->execute(Object(Magento\Framework\Event\Observer))
#27 .../vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Magento\Cron\Observer\ProcessCronQueueObserver), Object(Magento\Framework\Event\Observer))
#28 .../vendor/magento/module-staging/Model/Event/Manager.php(97): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
#29 .../generated/code/Magento/Staging/Model/Event/Manager/Proxy.php(95): Magento\Staging\Model\Event\Manager->dispatch('default', Array)
#30 .../vendor/magento/framework/App/Cron.php(86): Magento\Staging\Model\Event\Manager\Proxy->dispatch('default')
#31 .../vendor/magento/module-cron/Console/Command/CronCommand.php(117): Magento\Framework\App\Cron->launch()
#32 .../vendor/symfony/console/Command/Command.php(245): Magento\Cron\Console\Command\CronCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 .../vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#34 .../vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Cron\Console\Command\CronCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#35 .../vendor/magento/framework/Console/Cli.php(102): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 .../vendor/symfony/console/Application.php(117): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#37 .../bin/magento(23): Symfony\Component\Console\Application->run()
#38 {main} {"is_exception":false} []`

I looked in my database and i don't have the table amazon_sales_order but i don't understand why this table is used when it's a "normal" order.
Do you know what can be the problem ?

Regards

@cyattilakiss
Copy link
Contributor

Hi @dev-awevo ,

I tried to reproduce the error you experience, on a newly set up Magento 2.2.7, but unfortunately I didn't get any error during my tests.

The error is logged by the Adyen logger because in the Model/Cron.php we start with a try-catch block where we log all the exceptions that is thrown during the execute process. (Maybe it would be smarter from our side to catch only the AdyenExceptions and let the others bubble up to avoid confusions)

Also as I can see in the logs that you sent, I would say the following module causes the issue, which overwrites the getItems function which we also use in the Cron.php file:
"#13 .../vendor/magento/module-sales/Model/OrderRepository.php(127): Magento\Framework\Data\Collection->getItems()"

Just to be sure I did the same as you, could you please write me down which payment method caused the issue when you payed?
Also could you send me the repo for the module-sales plugin?

Regards,
Attila
Adyen

@dev-awevo
Copy link
Author

Hello,

I forgot to specify but i'm on an Enterprise version of Magento 2.2.7. Maybe it can help.
The method i used is the method by card with Mastercard. The module is on test version and not on live version.
As you said, you logged all the Exceptions in your try catch so maybe the error don't come from you rmodule. However i used the native method by check and i don't have any error.
I will take a look too.
Tell me if you find something

Regards

@cyattilakiss
Copy link
Contributor

Hi @dev-awevo ,

Thank you for the additional information.
After looking into it again today, it is possible that in the vendor/magento/module-sales you overwrite the native function and that's why you get this issue. (Unfortunately I don't have this customisation on my side that's why I cannot reproduce it I guess)

Best,
Attila
Adyen

@dev-awevo
Copy link
Author

Hello,

I found the problem.
I must have a problem when i installed Magento.
The table amazon_sales_order didn't exist.
I installed Magento again et reinstall the module and now i don't have problem.
Thanks for you help and sorry about that.

Regards

@dev-awevo
Copy link
Author

Hello,

I have an other question.
I've tried to pass an order. There is no problem.
After that i tried to refund the payment from the Adyen Plateform.
After that, on Magento i received a notification on my order
image
But nothing more happened.
The status of the order still Payment Review and there is no Credit Memo.
Is it normal or something must happened ?

Regards

@cyattilakiss
Copy link
Contributor

Hi @dev-awevo ,

Thank you for letting me know about the solution, happy to hear that you solved that.

When you refund, the Credit Memo should be created and other things should happen as well, which are defined in the vendor/adyen/model-payment/Model/Cron.php _refundOrder() function.
Could you please contact our support at support@adyen.com with the logs regarding to this issue?
(Logs can be found in your Magento2 rootFolder/var/log/adyen)

Best,
Attila
Adyen

@cyattilakiss
Copy link
Contributor

Hi @dev-awevo ,

I will close this issue for now, if you still have issues with the refund please contact our support and also mention me in your message please.

Best,
Attila
Adyen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants