cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

Hello community.

I would like to report an issue related to the "bin/magento setup:di:compile" command.

Since upgrading to version 2.4.6, I have encountered the following error:

 

Error message: /vendor/magento/module-inventory-sales-async-order/Model/ReservationExecution.php on line 19 Interface "Magento\InventorySales\Model\ReservationExecutionInterface" not found.

#0 /Users/x/PhpstormProjects/development/src/vendor/composer/ClassLoader.php(582): include()

 

Steps to reproduce the error:

  1. Update Magento to version 2.4.6.
  2. Execute the "composer upgrade" command.
  3. Execute the "bin/magento setup:di:compile" command.

Expected behavior: The "bin/magento setup:di:compile" command should execute successfully without any errors.

 

Current behavior: When executing the "bin/magento setup:di:compile" command, an error occurs indicating a missing interface. The interface "Magento\InventorySales\Model\ReservationExecutionInterface" in the file "/vendor/magento/module-inventory-sales-async-order/Model/ReservationExecution.php" cannot be found.

 

This error prevents me from successfully running the compilation script and impacts the functionality of the Magento installation.

 

Thank you for your assistance in addressing this issue. I look forward to your response and working together to resolve the error.

 

 
6 REPLIES 6

Re: Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

Hello @mschauerhe132f 

 

You can work around the issue by manually creating the interface "Magento\InventorySales\Model\ReservationExecutionInterface". To do this, open the file "/vendor/magento/module-inventory-sales-async-order/Model/ReservationExecution.php" and add the following code to the top of the file:

 

Was my answer helpful? You can accept it as a solution.
175+ Professional Extensions for M1 & M2
Need a developer?Just visit Contact Us Now

Re: Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

I had the same issue, you probably removed the inventory (MSI) modules entirely via composer (the `replace` hack). In Magento 2.4.6, `magento/module-inventory-sales-async-order` has been added as new inventory module.

 

You need to add it to the `replace` section in `composer.json` alongside with the other inventory modules

Re: Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

Here are the key steps I recommend to resolve the "interface not found" error when running bin/magento setup:di: compile after upgrading to Magento 2.4.6:

  • Update all Magento inventory modules to the latest compatible versions with the composer update
  • Clear generated, cached, and compiled files under var/
  • Manually delete the generated/code folder
  • Enable developer mode
  • Run bin/magento setup:upgrade before recompiling
  • As a last resort, remove the vendor folder and run composer install for fresh dependencies

This appears to be a version compatibility issue. Updating modules, clearing caches, and reinstalling dependencies should resolve it.

Re: Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

Was there ever a solution to this issue?
I'm experiencing exactly the same error after upgrading from 2.4.3 to 2.4.6

However we are using commerce cloud.

 

I have a "require" section in the composer.json file but if I do the suggested and add module-inventory-sales-async-order to it then I get the following error:

 

Problem 1
    - magento/magento-cloud-template is present at version 2.4.6 and cannot be modified by Composer
    - Only one of these can be installed: magento/module-inventory-sales-async-order[100.2.0], magento/magento-cloud-template[2.4.6]. magento/magento-cloud-template replaces magento/module-inventory-sales-async-order and thus cannot coexist with it.
    - magento/module-inventory-sales-async-order is locked to version 100.2.0 and an update of this package was not requested.

I have also tried the other solution of removing content in var & generated code before running setup:upgrade and then setup:di:compile, however the problem persists.

 

Is there another workaround. Someone mentioned adding some code to the ReservationExecution.php class but I don't actually see any code on this topic....

 

Thank you in advance for any help Smiley Happy

 

Re: Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

Same error here on upgrading from V2.4.3-p2 to 2.4.6-p2 community edition. 

Upgrading all composer modules does not help. Error still persists on compile. 
Is there any solution for this?

Re: Upgrading Magento 2.4.6 (CE) error with module-inventory-sales-async-order

problem solved by installing yireo/magento2-replace-inventory

 

composer require yireo/magento2-replace-inventory:^4.2.8