cancel
Showing results for 
Search instead for 
Did you mean: 

Issues when deploying static content on EFS

SOLVED

Issues when deploying static content on EFS

When running the static content deploy with jobs option, we get this error:

In Queue.php line 366:

Error while waiting for package deployed: 42; Status: 0

setup:static-content:deploy [-f|--force] [-s|--strategy [STRATEGY]] [-a|--area [AREA]] [--exclude-area [EXCLUDE-AREA]] [-t|--theme [THEME]] [--exclude-theme [EXCLUDE-THEME]] [-l|--language [LANGUAGE]] [--exclude-language [EXCLUDE-LANGUAGE]] [-j|--jobs [JOBS]] [--symlink-locale] [--content-version CONTENT-VERSION] [--refresh-content-version-only] [--no-javascript] [--no-css] [--no-less] [--no-images] [--no-fonts] [--no-html] [--no-misc] [--no-html-minify] [--] [<languages>...]

Static content deploy command:

magento setup:static-content:deploy --jobs 5
1 ACCEPTED SOLUTION

Accepted Solutions

Re: 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#L391And 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:

Deploy using quick strategy
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

View solution in original post

1 REPLY 1

Re: 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#L391And 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:

Deploy using quick strategy
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