mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.35k stars 490 forks source link

Mina setup and migrations: Files /home/base/rails/current/db/migrate/xxx.rb and ./db/migrate/xxx.rb differ #502

Closed jmuheim closed 7 years ago

jmuheim commented 7 years ago

I followed the guide in https://github.com/mina-deploy/mina/blob/master/docs/getting_started.md step by step.

I run mina setup --verbose, and everything seems fine.

I then run mina deploy --verbose, and after installing the gems successfully, I get this:

       Files /home/base/rails/current/db/migrate/20131224105939_devise_create_users.rb and ./db/migrate/20131224105939_devise_create_users.rb differ
       Files /home/base/rails/current/db/migrate/20140228115711_rolify_create_roles.rb and ./db/migrate/20140228115711_rolify_create_roles.rb differ

No idea what this means and whether I should do something. Is this related to mina anyway?

jmuheim commented 7 years ago

Also during the migrations, I get some of them:

   $ RAILS_ENV="production" bundle exec rake db:migrate
   == 20161212151729 ChangeVersionsObjectToMediumText: migrating =================
   -- change_column(:versions, :object, :text, {:limit=>16777215})
      -> 0.4599s
   == 20161212151729 ChangeVersionsObjectToMediumText: migrated (0.4601s) ========

   Files /home/base/rails/current/vendor/assets/javascripts/jasny-bootstrap.js and ./vendor/assets/javascripts/jasny-bootstrap.js differ
dparfrey commented 6 years ago

@jmuheim I'm running into the same "files differ" issue. If I skip the migration, the assets precompile step does the same thing.

What did you do to resolve this? I've deployed many sites with Mina before and have never gotten this. Has to be something basic, but I can't figure it out.

Thanks!

jmuheim commented 6 years ago

In the meantime I felt like this is the normal behaviour: mina detects changes in asset files and triggers recompile on the server, or it detects changes in migration files and trigger migration on the server.

Am I wrong? Is this something suspicious?

dparfrey commented 6 years ago

The problem is, it's detecting changes between my local migration files and the cloned GitHub version, and there aren't any changes. The result is to stop the deploy and not even try to run the migration (or precompile the assets). It's part of the mina script, and I agree it should be there, but don't know why it's malfunctioning for me. It's just a diff!

I've discovered some other strange behavior on my server, too, so the mina issues are likely caused by whatever else is going on. I'll post again when I figure it out (for posterity).

Thanks for replying!

jmuheim commented 6 years ago

Good luck! I learned a new word today, "posterity", and I'm happy that this ticket got a bit more "posterious" (is this a real word, haha?!) thanks to this conversation. 😅

dparfrey commented 6 years ago

This took longer to figure out than I ever dreamed! Oddly enough, my secrets.yml file was missing the # on the first line (bad copy/paste from another file).

I have no idea why that generated the errors it did. I figured it out after trying to run the migration on the server, which generated a different, a bit more helpful, error.

Hope this helps someone else!