1

I have upgraded Magento 2.3.5-p1 to Magento 2.4.0, after upgrade when I am running compile command

php bin/magento setup:di:compile

then it's showing me below error

Compilation was started.
Area configuration aggregation... 5/8 [=================>----------]  62% 36 secs 440.0 MiB
In ClassReader.php line 43:
                                                                                      
  Class Magento\InventoryCatalogAdminUi\Observer\SourceItemsProcessor does not exist  
                                                                                      

In ClassReader.php line 36:
                                                                                      
  Class Magento\InventoryCatalogAdminUi\Observer\SourceItemsProcessor does not exist  
                                                                                  

In error log it's showing below error.

    [2020-08-07 05:17:25] main.CRITICAL: Can't create directory /var/www/html/generated/code/Magento/Framework/App/ResourceConnection/.
Class Magento\Framework\App\ResourceConnection\Proxy generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. [] []
[2020-08-07 05:17:25] main.DEBUG: Can't create directory /var/www/html/generated/code/Magento/Framework/App/ResourceConnection/.
Class Magento\Framework\App\ResourceConnection\Proxy generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. {"exception":"[object] (RuntimeException(code: 0): Can't create directory /var/www/html/generated/code/Magento/Framework/App/ResourceConnection/.
Class Magento\\Framework\\App\\ResourceConnection\\Proxy generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. at /var/www/html/vendor/magento/framework/Code/Generator.php:139)"} []

I give proper permission also to the generated folder before running compile command, but it's not working

chmod -R 777 var pub generated

I give below permissions also but it's not working

find . -type f -exec chmod 644 {} \;

find . -type d -exec chmod 755 {} \;

I never face this issue previously in the same installation. Please let me know where I am doing wrong here.

4
  • try composer update then run setup:upgrade and setup:di:compile Aug 7 '20 at 6:53
  • I tried but it's not working Aug 7 '20 at 7:34
  • try composer require magento/module-inventory-catalog-admin-ui then use composer update Aug 7 '20 at 7:46
  • It's showing below message, composer require magento/module-inventory-catalog-admin-ui Do not run Composer as root/super user! See getcomposer.org/root for details Using version ^1.1 for magento/module-inventory-catalog-admin-ui ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Aug 10 '20 at 4:48
2

I have solved this issue by removing non exist class which was used by 3rd party module

the class has moved in https://github.com/magento/inventory/commit/9f17e1a256059bd970ab8d1feefabb68915316f9#diff-91c461452870c39b2ced9d19d1051837:

InventoryCatalogAdminUi/Observer/SourceItemsProcessor.php → InventoryCatalog/Model/SourceItemsProcessor.php

Not the answer you're looking for? Browse other questions tagged or ask your own question.