ruby-on-railsamazon-web-servicesaws-opsworks

OpsWorks deploy failed after bundle exec rake assets:precompile


I'm trying to deploy an application using AWS OpsWorks with chef, I had have run the deploy in other times and had never failed but this time I got the next message in the log. I run the command bundle exec rake assets:precompile] in localhost and everything is alright, What can be?

[2018-03-01T18:50:54+00:00] INFO: Processing execute[cd 
/srv/www/my_project/releases/20180301185045 && RAILS_ENV=production bundle 
exec rake assets:precompile] action run 
(/opt/aws/opsworks/releases/20160504095744_3437-
20160504095744/vendor/bundle/ruby/2.0.0/gems/chef-
11.10.4/lib/chef/provider/deploy.rb line 63)

Error executing action 'run' on resource 'execute[cd 
/srv/www/my_project/releases/20180301185045 && RAILS_ENV=production bundle 
exec rake assets:precompile]' 

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '137'
---- Begin output of cd /srv/www/my_project/releases/20180301185045 && 
RAILS_ENV=production bundle exec rake assets:precompile ----
STDOUT: 

Solution

  • Sometimes the instances got out of memory. Only stop and start the instance where you are doing the deploy.