Question:
I have provided to my Elastic Beanstalk environment nginx configuration according to this article. My application sits in a Docker container. The problem is that the environment fails to reload nginx.
Here’s my config file:
1 2 3 4 5 6 7 8 9 10 11 12 |
files: "/etc/nginx/conf.d/proxy.conf" : mode: "000644" owner: root group: root content: | client_max_body_size 500M; container_commands: 01_reload_nginx: command: "sudo service nginx reload" |
And that results in failure (after /var/log/eb-activity.log
):
1 2 3 4 5 6 7 8 9 10 11 12 13 |
EmbeddedPostBuild/postbuild_0_audio_explorer] : Starting activity... [2019-03-04T21:45:01.064Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer/Command 01_reload_nginx] : Starting activity... [2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer/Command 01_reload_nginx] : Activity execution failed, because: (ElasticBeanstalk::ExternalInvocationError) [2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer/Command 01_reload_nginx] : Activity failed. [2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer] : Activity failed. [2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Activity failed. [2019-03-04T21:45:01.122Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild] : Activity failed. [2019-03-04T21:45:01.122Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0] : Activity failed. [2019-03-04T21:45:01.122Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1] : Completed activity. Result: Application deployment - Command CMD-Startup failed |
When I remove section:
1 2 3 4 |
container_commands: 01_reload_nginx: command: "sudo service nginx reload" |
Deployment goes smooth.
Any ideas? How can I get information on what precisely goes wrong with the command? If I ssh to my instance, I can execute command without a problem.
Answer:
The elastic beanstalk deployment process will do the nginx reload for you, so you can remove it from your script permanently and avoid the error. Figuring out why exactly the command failed will just be academic