Trying to deploy an IIS application to AWS Elastic Beanstalk via Visual Studio 2015. Every time we try to deploy it we get the following errors:
Error occurred during build: Command hooks failed
[Instance: i-XXXXXXXX ConfigSet: Infra-WriteRuntimeConfig, Infra-WriteApplication1,
Infra-WriteApplication2, Infra-EmbeddedPreBuild, Hook-PreAppDeploy,
Infra-EmbeddedPostBuild, Hook-EnactAppDeploy, Hook-PostAppDeploy]
Command failed on instance. Return code: 1 Output: null.
Unsuccessful command execution on instance id(s) 'i-XXXXXXXX'. Aborting the operation.
We've tried restarting the Application. We've tried deleting and recreating the Environment and Application. All to no success. Always the same error. I cannot find anything online anywhere that tells how to fix this. Has anyone else run into this problem and found a solution?
The Beanstalk deployment errors are usually quite generic.
To get the root cause, the troubleshooting steps are the ones in AWS Elastic Beanstalk Troubleshooting doc:
Check the Hooks you have created correct in source code for example,
Hooks should be created in this path of the root of your project
.platform/hooks/postdeploy/
.platform/hooks/predeploy/

If you created a bash hooks you have to give permission for that before it execute so set permission for the hooks in .ebextensions as like below image shows

if above all are correct then, Check the EB logs, for that you have to login to the current instance.
IF the instance is attached with your key pair you can directly login to the ssh or else you have to create a ssh keypair and attach to the instance a shown below

Then Apply changes to the EB Application and Login to the instance with ssh
and check the below logs
ls /var/log/
cat /var/log/eb-hooks.log

You can also check the Detailed log's of EB Engine using
cat /var/log/eb-engine.log
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With