Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db:migrate failing on install w/ v2.5.1 #22

Closed
fbrier opened this issue Jul 4, 2014 · 5 comments
Closed

db:migrate failing on install w/ v2.5.1 #22

fbrier opened this issue Jul 4, 2014 · 5 comments

Comments

@fbrier
Copy link

fbrier commented Jul 4, 2014

This is my first time using this cookbook. I have repeated the install twice on clean Ubuntu 12.04 LTS VMs and got the same result. The cookbook fetches and installs redmine with no problem and then fails on the deploy running db:migrate. I had set the revision attribute to 2.5.1, which is the latest version. Has anyone else seen this? Thank you.

================================================================================
Error executing action `deploy` on resource 'deploy_revision[/opt/redmine]'
================================================================================


Chef::Exceptions::Exec
----------------------
rake db:migrate returned 1, expected 0

Amending since the above comment, I created a bare bones role, letting the revision default to 2.2.4, again on a clean VM, and it worked. Using another bare bones role, but setting just the revision to 2.5.1, it failed as above.

@fbrier
Copy link
Author

fbrier commented Jul 6, 2014

I read through all the Redmine release notes between 2.2.4 and 2.5.1 and saw no changes to the tools or ruby libraries or packages or database features that would explain why 2.5.1 would behave differently on a clean install. Also, why would db:migrate execute on a clean install?

@fbrier
Copy link
Author

fbrier commented Jul 7, 2014

So I noticed the mysql gem was not installed. So I installed it. Didn't work. But I did see Juanje's comment about the Chef gems possibly being in a different path. After reading about Chef logging, I re-ran chef-client and got the message, "Could not find gem 'mysql (~> 2.8.1) ruby' in the gems available on this machine." But then I read that Redmine does not include the mysql gem in its bundle definition and you have to specify it when installing. So why would it work for 2.2.4 and not 2.5.1? That has not changed. Still researching...

@fbrier
Copy link
Author

fbrier commented Jul 8, 2014

Something must have changed to require the mysql gem to be added. In recipes/source.rb, the mysql gem has to be explicitly added:

     gem_package "bundler" do
       action :install
     end
+    gem_package "mysql" do
+      package_name "mysql"
+      version "2.8.1"
+      action :install
+    end

This seems to have solved the problem as 2.5.1 stable is now installed and operational. I did make one other change that I believe is unrelated, but appears to be a bug. In the same file, it appears that the execute bundle install command's parameters are reversed. Please feel free to let me know if I am off-base on these changes. Thank you.

     case adapter
     when "mysql"
-      execute "bundle install --without development test postgresql sqlite" do
+      execute "bundle install --without development test mysql sqlite" do
         cwd release_path
       end
     when "postgresql"
-      execute "bundle install --without development test mysql sqlite" do
+      execute "bundle install --without development test postgresql sqlite" do
         cwd release_path
       end
     end

@fbrier fbrier closed this as completed Jul 8, 2014
@jniggemann
Copy link

Never looked at chef before and chances are I might be wrong about this, but

when "mysql"
   execute "bundle install --without development test mysql sqlite" do
   cwd release_path

doesn't look OK: You're in a case statement branch with adapter==mysql, hence it makes no sense to tell bundler to not use the mysql database...

@fbrier
Copy link
Author

fbrier commented Jul 10, 2014

Thank you for logging into the project. Your hint on the redmine website zeroed me in. I'd actually caught the error you saw and posted it in the previous comment, although I don't think that is what was causing the db:migrate to fail. Thank you again. My next thought is to figure out how to do redmine plugins in the cookbook and integrate julionc's gitolite cookbook with the gitolite/redmine integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants