AWS CodeDeploy – Fix Script Failed to Complete in 5 Seconds Error

amazon-web-servicesdeployment

I'm using AWS CodeDeploy and getting an error message:

Script at specified location: … "failed to complete in 5 seconds"

the script is called from appspec.yml->hooks:->BeforeInstall:

How can I fix it?

Is it an indication of something?
Why is it 5 seconds limit?
How can I increase it?

Best Answer

You can specify a timeout for each stage, see CodeDeploy — Structure of 'hooks' Section.

For example to set it to 120 seconds:

hooks:
 BeforeInstall:
 - location: /script/location/xyz.sh
   timeout: 120

Hope that helps :)