Can’t compile Magento site after migration to production

I’m in the process of migrating a Magento 2 install to AWS, and have been running into an issue when running the command:

php bin/magento setup:di:compile

When running the command, the compiling process stops at 44% and outputs the following errors:

In Generator.php line 140:

Class PelagoEmogrifier does not exist

Class BssHtmlSiteMapModelFilterInterceptor 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 g

enerate properly, then you must add the generated class object to the signature of the related construct method, only.

Things I’ve tried:

  • Ran the command as both root and site user
  • Changed the permissions for /generated/* and var/* to 777 (as a test)
  • Chown /generated/* and var/* to site user
  • Ran composer update
  • Cleared/flushed Magento cache

And none of the above has worked. Any ideas would be greatly appreciated!

submitted by /u/Flipnotic
[link] [comments]