Magento 2: Issues when deploying static content on EFS
There is an issue open on Magento 2 repository and I even added a comment there: https://github.com/magento/magento2/issues/21852
This issue might be caused by this: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Deploy/Process/Queue.php#L391 And the function for the timeout: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Deploy/Process/Queue.php#L372 All points to const DEFAULT_MAX_EXEC_TIME = 400; https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Deploy/Process/Queue.php#L32
So it looks like if the static code deploy runs for over 400 seconds, it will fail. But Magento has fixed their ECE tool to add an option to increase the timeout: https://github.com/magento/ece-tools/pull/418. But for now this is not fixed on the Magento Open Source or Commerce edition.
So what can you do? Well, for now what we are going to do is to store the theme information for a store somewhere and when a code is deployed we get the theme and deploy only the theme assigned to a store. So for example if MageBR/mytheme is assigned to my store, I will run:
magento setup:static-content:deploy --theme MageBR/mytheme
It will speed things up and not fail as we can see below:
frontend/Magento/blank/en_US 2456/2456 ============================ 100% % 1 min
frontend/MageBR/base/en_US 2765/2765 ============================ 100% % 2 mins
frontend/MageBR/mytheme/en_US 2765/2765 ============================ 100% % 2 mins
Execution time: 483.77401208878
I have the full article explaining here: https://magebr.com/issues-when-deploying-static-content-efs