- From: Toby Johnson <
>
- To:
- Subject: [chef] Rails db:migrate fails via knife, succeeds when run directly
- Date: Mon, 17 Feb 2014 21:51:25 -0500
I'm using the deploy cookbook to deploy a Rails app (nginx + passenger). I'm running "bundle exec rake db:migrate --trace" during the migration step, after the database is created. Many times this step will fail with:
ERROR: deploy_revision[/var/www] (_site::deploy line 39) had an error: Chef::Exceptions::Exec: bundle exec rake db:migrate --trace returned 1, expected 0
It is very frustrating because it will sometimes succeed but often will fail. It seems like more often, when I run via knife ssh ("knife ssh 'fqdn:xxx*' 'sudo chef-client'), it will fail at the above step, then I ssh into the actual box, start a shell as root ("sudo su -") then run chef-client and it will succeed.
I see that the unix error code "1" means a permissions issue; is that what I'm facing here or is rake (er, bundle I guess) just using this as a generic error return code? Any way I can get a more specific reason as to why the migrate is failing?
The chef-stacktrace.out file doesn't give any more specific info about the actual db:migrate failure.
- [chef] Rails db:migrate fails via knife, succeeds when run directly, Toby Johnson, 02/17/2014
Archive powered by MHonArc 2.6.16.