I have a Ruby Stack configured with AWS Elastic Beanstalk. Last week, all my deployments were ok, but since I tried to change my MySQL RDS DB to use UTF-8, I got this problem each time I run an eb deploy
:
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: UnicodeEncodeError :: 'ascii' codec can't encode character u'\u2018' in position 90: ordinal not in range(128)
When I check on the AWS EB interface, I got this error message :
[Instance: i-2a4575cc] Command failed on instance. Return code: 1 Output: cp: cannot stat ‘/var/tmp/backup/10_bundle_install.sh’: No such file or directory. Hook /opt/elasticbeanstalk/hooks/appdeploy/post/05_revert_bundle_install_local.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
Finally, I checked inside the /var/log/eb-activity.log as mentionned above, and the last lines are the following :
[2015-06-16T09:03:39.079Z] INFO [23525] - [CMD-AppDeploy/AppDeployStage1/AppDeployEnactHook] : Completed activity. Result:
Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/enact.
[2015-06-16T09:03:39.079Z] INFO [23525] - [CMD-AppDeploy/AppDeployStage1/AppDeployPostHook] : Starting activity...
[2015-06-16T09:03:39.079Z] INFO [23525] - [CMD-AppDeploy/AppDeployStage1/AppDeployPostHook/05_revert_bundle_install_local.sh] : Starting activity...
[2015-06-16T09:03:39.088Z] INFO [23525] - [CMD-AppDeploy/AppDeployStage1/AppDeployPostHook/05_revert_bundle_install_local.sh] : Activity execution failed, because: cp: cannot stat ‘/var/tmp/backup/10_bundle_install.sh’: No such file or directory (ElasticBeanstalk::ExternalInvocationError)
caused by: cp: cannot stat ‘/var/tmp/backup/10_bundle_install.sh’: No such file or directory (Executor::NonZeroExitStatus)
[2015-06-16T09:03:39.088Z] INFO [23525] - [CMD-AppDeploy/AppDeployStage1/AppDeployPostHook/05_revert_bundle_install_local.sh] : Activity failed.
[2015-06-16T09:03:39.088Z] INFO [23525] - [CMD AppDeploy/AppDeployStage1/AppDeployPostHook] : Activity failed.
[2015-06-16T09:03:39.088Z] INFO [23525] - [CMD-AppDeploy/AppDeployStage1] : Activity failed.
[2015-06-16T09:03:39.088Z] INFO [23525] - [CMD-AppDeploy] : Completed activity. Result:
Command CMD-AppDeploy failed.
The problem seems to come from the cp
command requested in the 05_revert_bundle_install_local.sh script :
cp -a /var/tmp/backup/10_bundle_install.sh /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh
The /var/tmp/backup/10_bundle_install.sh doesn't exist.
Do you know what could have happened ? And how can I solve it to avoid the error message and make clean deployments ?
Thank you !
Have a look here.
Apparently when installing the default sample app, beanstalk also installs this file and "forgets" to delete it. So the solution is simply to delete it manually.