- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
Hello,
It might be quite challenging to analyze this issue because a support case would helpful so as to get logs and more details. However at a high level, I would say the common cause I have seen is similar to your scenario. In this case, it was discovered that a gem or script was modifying the directory.
Most of the time that's the root cause, which is where a custom script assumes the directory exists or assumes it is empty and tries to alter the directory. Elastic Beanstalk (EB) doesn't want scripts altering this directory as EB prepares everything usually into /var/app/staging and copies over into /var/app/current.
It is recommended to not modify the /var/app/current so it does not interfere with how EB maintains it. If any scripts needs to write/modify files of a new application version, using something like container commands is better. Container commands are commands ran in the /var/app/staging directory before files are copied to /var/app/current.
As for why it happens sometimes and not others, deployment scripts that try to modify the /var/app/current directory can behave very differently on first time deployment vs subsequent deployments to the same EC2 instance. It is much safer to manipulate files in /var/app/staging and allow EB to move the final files to /var/app/current for you.
An additional helpful link is Platform hooks. Note that using different ebextension blocks (ex. container commands instead of commands) or using the newer platform hooks such as post deploy hooks will have different behavior and run in different order and you would have to experiment or consider what one best fits your needs.
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 3 Monaten
- AWS OFFICIALAktualisiert vor 7 Monaten
- AWS OFFICIALAktualisiert vor 2 Jahren
Thank you for the answer,Ugochukwu_I.
JoeyParis, Thank you for using re:Post. Let us know if this answers your question. If this solved your issue, please remember to click on the "Accept" button to let the community know that your question is resolved. This helps everyone. Thank you in advance.