"Multiple migrations have the name CreateTaggerTags" ERROR when bundle exec rake db:migrate


(Raul ) #1

Hi,

Please I have the next error when upgrading from 1.1.3 to 1.3.beta7 (latest release).

The wierd thing is that in testing I do not have such error, I did the database upgrade to postgresql-9.4 in order to have the json types ready and the db:migrate successfully, but now when executing rake db:migrate but in production I got this:

RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Invoke set_locale (first_time)
** Execute set_locale
** Execute db:migrate
rake aborted!
ActiveRecord::DuplicateMigrationNameError:

Multiple migrations have the name CreateTaggerTags

/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/migration.rb:1017:in `validate'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/migration.rb:923:in `initialize'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/migration.rb:814:in `new'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/migration.rb:814:in `up'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/migration.rb:792:in `migrate'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.10/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/kingadmin/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/fjord/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/fjord/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'
Tasks: TOP => db:migrat

Please will appreciate a lot any kind of feedback because is urgent, many thanks in advance


(Sam Saffron) #2

Tagger gem is unsupported and retired, use


(Raul ) #3

Hi Sam, thanks a lot for the info

We are not using docker yet, but the aim of the migration to the latest version is because I would like to move the discourse to Docker so support will be way easier, but I still have few questions:

  • To delete the unsuported plugin “discourse-plugin-tagger”, is enough
    to just remove the files from the discourse/plugins and rebuild the
    application by means of bundle install --without test --deployment,
    bundle exec rake db:migrate and assets:precompile ?

  • Regarding installation of the discourse-tagging plugin, I do not find any
    install documentation for non docker users. What are the steps to do
    the installation? Can someone help here?

    cd path/discourse/plugins
    git clone GitHub - discourse/discourse-tagging: Tagging functionality for Discourse Forums # clone the repo here
    cd …
    miss some commands here (sorry not so many ruby experience…)

Again thanks a lot for the support and looking forward for your hints

Regards


(Raul ) #4

Hi

Sorry maybe it’s me doing something wrong, but there is no app.yml on the filesystem so the next command outputs nothing:

find . -type f -iname "app.yml"

I am not running on docker, so I guess is because of this.

If I just clone the code of the plugin in the directory plugins like this:

git clone https://github.com/discourse/discourse-tagging.git discourse/plugins/discourse-tagging

And then when trying to migrate the db I got this:

RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake db:migrate --trace
rake aborted!
NoMethodError: undefined method `enabled_site_setting' for #<Plugin::Instance:0x000000020ecde0>
/fjord/discourse/plugins/discourse-tagging/plugin.rb:7:in `activate!'
/fjord/discourse/lib/plugin/instance.rb:171:in `instance_eval'
/fjord/discourse/lib/plugin/instance.rb:171:in `activate!'
/fjord/discourse/lib/discourse.rb:84:in `block in activate_plugins!'
/fjord/discourse/lib/discourse.rb:84:in `each'
/fjord/discourse/lib/discourse.rb:84:in `activate_plugins!'
/fjord/discourse/config/application.rb:154:in `<class:Application>'
/fjord/discourse/config/application.rb:19:in `<module:Discourse>'
/fjord/discourse/config/application.rb:18:in `<top (required)>'
/fjord/discourse/Rakefile:5:in `require'
/fjord/discourse/Rakefile:5:in `<top (required)>'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/fjord/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/fjord/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/fjord/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'

So I need to run more command here, but I do not know them… sorry I am not used to work with ruby, I miss some info in the README as used to be in the older plugin for manual installation, will appreciate a lot if someone can give some hints here so until then I won’t be able to upgrade and move to docker

Thanks a lot for the support


(Kane York) #5

I think you need to do this first:

RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake db:rollback SCOPE=tagger

(Sam Saffron) #6

You got to be on latest to use the tagger plugin, just upgrade to latest without it and then add it to the mix.

Keep in mind NO data is migrated from the old tagger plugin, if you want to migrate tags you are going to have to write a custom script.