DanThiffault / rails-lastmile

Chef rails configuration
MIT License
28 stars 23 forks source link

Works on "vagrant up" later fails on a "vagrant provision" #4

Closed axelson closed 11 years ago

axelson commented 11 years ago

Initially works after doing a "vagrant destroy", then a "vagrant up". But running "vagrant provision" without rebooting fails with the following error:

STDERR: master failed to start, check stderr log for details ---- End output of "bash" "/tmp/chef-script20121212-2556-vyw5zb-0" ---- Ran "bash" "/tmp/chef-script20121212-2556-vyw5zb-0" returned 1

Resource Declaration:

In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/script.rb

27: 28: script new_resource.name do 29: interpreter "bash" 30: code script_code 31: user new_resource.user if new_resource.user 32: creates new_resource.creates if new_resource.creates 33: cwd new_resource.cwd if new_resource.cwd 34: group new_resource.group if new_resource.group 35: path new_resource.path if new_resource.path 36: returns new_resource.returns if new_resource.returns 37: timeout new_resource.timeout if new_resource.timeout 38: umask new_resource.umask if new_resource.umask 39: environment(script_environment) 40: end 41:

Compiled Resource:

Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/script.rb:28:in `class_from_file'

script("run-rails") do retry_delay 2 environment {"RBENV_ROOT"=>"/usr/local/rbenv"} returns [0] command "\"bash\" \"/tmp/chef-script20121212-2556-vyw5zb-0\"" retries 0 code "export RBENV_ROOT=\"/usr/local/rbenv\"\nexport PATH=\"${RBENV_ROOT}/bin:$PATH\"\neval \"$(rbenv init -)\"\n\nrbenv shell 1.9.3-p286\n\nbundle install\nbundle exec unicorn -c /etc /unicorn.cfg -D\n\n" cwd "/vagrant" action "run" cookbook_name :"rails-lastmile" interpreter "bash" backup 5 end

[2012-12-12T03:20:58+00:00] ERROR: Running exception handlers [2012-12-12T03:20:58+00:00] ERROR: Exception handlers complete [2012-12-12T03:20:58+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out [2012-12-12T03:20:58+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: script[run-rails](/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rbenv/providers/script.rb line 28) had an error: Mix lib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'

Am I doing something wrong or is this a bug?

DanThiffault commented 11 years ago

Hey @axelson I'm slammed today, but I'll try and reproduce tonight on my system. Will let you know if it appears to be an environment/code issue. In the meantime, what versions are you using of VirtualBox, ruby, OS, etc.?

axelson commented 11 years ago

I'm using Ubuntu 12.10 64-bit. Virtualbox 4.1.18-dfsg-1ubuntu1.1 (--version reports 4.2.4r81684), and ruby 1.9.3p194.

It seems to be working now, not sure what the difference is.

axelson commented 11 years ago

Actually you can ignore the comment about it working. I forgot that I commented out rails-lastmile to test my own provisioning faster.

But now I think I'm running into this issue: https://github.com/sstephenson/rbenv/pull/291

Going to try testing with an older version of rbenv.

Here's a snippet of the error message: Expected process to exit with [0], but received '127' ---- Begin output of "bash" "/tmp/chef-script20121213-1084-awhht8-0" ---- STDOUT: export PATH="/usr/local/rbenv/shims:${PATH}" source "/usr/local/rbenv/libexec/../completions/rbenv.bash" rbenv rehash 2>/dev/null STDERR: /usr/local/rbenv/libexec/rbenv-init: line 85: rbenv-commands: command not found ---- End output of "bash" "/tmp/chef-script20121213-1084-awhht8-0" ---- Ran "bash" "/tmp/chef-script20121213-1084-awhht8-0" returned 127

Edit: just realized that the version of rbenv is already set to a tag

axelson commented 11 years ago

You can ignore the other comments. I've figured out and patched the issue (actually two separate issues that I've patched separately). The fix for the titular issue is pull #6:

https://github.com/DanThiffault/rails-lastmile/pull/6

DanThiffault commented 11 years ago

wow that's fantastic thank you. will merge in today

On Dec 14, 2012, at 6:03, Jason Axelson notifications@github.com wrote:

You can ignore the other comments. I've figured out and patched the issue (actually two separate issues that I've patched separately). The fix for the titular issue is pull

6https://github.com/DanThiffault/rails-lastmile/issues/6

:

6 https://github.com/DanThiffault/rails-lastmile/issues/6

— Reply to this email directly or view it on GitHubhttps://github.com/DanThiffault/rails-lastmile/issues/4#issuecomment-11360448.