3

We have developed one Magento2 Website Version - 2.2.1, in every instance - Production, Staging and Local facing the same issue as:

Error while running php bin/magento setup:di:compile

Repositories code generation breaks every time in 14% or 1/7 instance.

Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec 56.0 MiB

enter image description here

6
  • Can error log ..
    – Amit Bera
    Sep 20, 2019 at 7:39
  • no error on log. Sep 20, 2019 at 7:42
  • just run this and see what error you get ? php bin/magento Sep 20, 2019 at 7:54
  • no error by this command Sep 20, 2019 at 7:56
  • can you run with this command: php -d memory_limit=5G bin/magento setup:di:compile Sep 20, 2019 at 7:58

1 Answer 1

4

Not sure if you would like it as a method but try to remove all modules in

app/code

(especially remove the modules added recently , the last time you remember the compile went fine ) .

There might be an issue on an __construct you have called on one of those modules. Add the modules one by one . Test on the local/dev site first.

After removing the modules , dont forget to do :

rm -rf var/generation/*
5
  • Okay let me try this Sep 20, 2019 at 7:58
  • i have checked with disable all modules, same issue Sep 20, 2019 at 8:51
  • not to disable , to remove them. Sep 20, 2019 at 8:54
  • 1
    Yes, It is working now. Thanks for Valuable answer. Sep 20, 2019 at 10:25
  • 1
    Im happy it worked :) Sep 20, 2019 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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