cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4.3-p1 Error while programmatically create order via cron

Magento 2.4.3-p1 Error while programmatically create order via cron

Hello, I followed this tutorial to add programmatically create order creating, and it works. But when it runs via cron job it return error message:

Type Error occurred when creating object: Magento\InventoryIndexer\Model\Queue\ReservationData, Argument 2 passed to Magento\InventoryIndexer\Model\Queue\ReservationData::__construct() must be of the type int, null given, called in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

 

I already tried:

bin/magento setup:upgrade 
bin/magento setup:di:compile
bin/magento cache:flush 
bin/magento cache:clean

I also deleted the contents of the folder /generated and rerun previous commands and it still return that error. 

 

Error happening after this line:

 $order = $this->quoteManagement->submit($quote);

Do somebody know how to fix or debug it? I will be very grateful