fraoustin / redmine_indicator

13 stars 8 forks source link

Error when deleting the plugin. ``undefined method `delete' for nil:NilClass`` #22

Open n0rvik opened 1 year ago

n0rvik commented 1 year ago

Hello! Error when deleting the plugin.

OS : CentOS 8 Steam

Redmine

Environment:
  Redmine version                4.1.1.stable
  Ruby version                   2.6.6-p146 (2020-03-31) [x86_64-linux]
  Rails version                  5.2.4.2
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Mercurial                      5.3
  Git                            2.9.5
  Filesystem                     
Redmine plugins:
  redmine_banner                 0.3.4
  redmine_drawio                 1.4.6
  redmine_image_clipboard_paste  3.3.0
  redmine_indicator              0.2.16
  redmine_tags                   4.0.0
  redmine_theme_changer          0.5.0
  redmine_tint_issues            1.3.2

Command and result

 bundle exec rake redmine:plugins:migrate NAME=redmine_indicator VERSION=0 RAILS_ENV=production
== 20200519 IndicatorProjectSttingsAdd: reverting =============================
-- remove_column(:projects, :indicator_left_top, :text)
   -> 0.0023s
-- remove_column(:projects, :indicator_left_bottom, :text)
   -> 0.0009s
-- remove_column(:projects, :indicator_right, :text)
   -> 0.0009s
== 20200519 IndicatorProjectSttingsAdd: reverted (0.1347s) ====================

== 20191221 IndicatorCustomFields: reverting ==================================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

undefined method `delete' for nil:NilClass
/opt/redmine-4.1.1/plugins/redmine_indicator/db/migrate/20191221_indicator_custom_fields.rb:31:in `down'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:783:in `down'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:817:in `exec_migration'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:797:in `block in migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:796:in `migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:977:in `migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/transactions.rb:212:in `transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1343:in `ddl_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1262:in `each'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1210:in `block in migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1210:in `migrate'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:520:in `down'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1015:in `migrate'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:542:in `migrate_plugin'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:483:in `migrate'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:494:in `migrate'
/opt/redmine-4.1.1/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.6.6@redmine/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.6.6@redmine/bin/ruby_executable_hooks:24:in `<main>'

Caused by:
NoMethodError: undefined method `delete' for nil:NilClass
/opt/redmine-4.1.1/plugins/redmine_indicator/db/migrate/20191221_indicator_custom_fields.rb:31:in `down'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:783:in `down'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:817:in `exec_migration'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:797:in `block in migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:796:in `migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:977:in `migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/transactions.rb:212:in `transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1343:in `ddl_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1262:in `each'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1210:in `block in migrate'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1210:in `migrate'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:520:in `down'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/activerecord-5.2.4.2/lib/active_record/migration.rb:1015:in `migrate'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:542:in `migrate_plugin'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:483:in `migrate'
/opt/redmine-4.1.1/lib/redmine/plugin.rb:494:in `migrate'
/opt/redmine-4.1.1/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.6.6@redmine/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.6.6@redmine/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.6.6@redmine/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)
qawsed55 commented 1 year ago

also have this trouble on 5.0.4

Environment:

  Redmine version                5.0.4.stable
  Ruby version                   2.7.4-p191 (2021-07-07) [x86_64-linux-gnu]
  Rails version                  6.1.7
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Purplemine2 (includes JavaScript)
SCM:
  Git                            2.30.2
  Filesystem                     
Redmine plugins:
  additionals                    3.0.8
  easy_mindmup                   2.0
  easy_wbs                       2.0
  issue_recurring                1.7
  mega_calendar                  1.9.3
  redmine_checklists             3.1.22
  redmine_ckeditor               1.2.4
  redmine_dashboard              2.12.4
  redmine_disable_auther_notification_plugin 0.5
  redmine_dmsf                   3.0.8
  redmine_impersonate            2.0.0
  redmine_indicator              0.2.16
  redmine_issue_dynamic_edit     0.9.1
  redmine_issue_view_columns     2.0.2
  redmine_issues_tree            0.0.15
  redmine_messenger              1.0.15
  redmine_project_themes         1.2.0
  redmine_tint_issues            1.3.2
  redmine_vividtone_my_page_blocks 2017/07/05
  redmine_x_lightbox2            1.0.0
  redmine_xapian                 3.0.2
  redmine_xlsx_format_issue_exporter 0.2.0
  view_customize                 3.3.0

redmine@redmine5:~$ bundle exec rake redmine:plugins:migrate RAILS_ENV=production VERSION=0 NAME=redmine_indicator
== 20191221 IndicatorCustomFields: reverting ==================================
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

undefined method `delete' for nil:NilClass
/opt/redmine/plugins/redmine_indicator/db/migrate/20191221_indicator_custom_fields.rb:31:in `down'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:836:in `down'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:870:in `public_send'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:870:in `exec_migration'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:850:in `block in migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:849:in `migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1037:in `migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1382:in `ddl_transaction'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1302:in `each'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1251:in `block in migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1251:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:478:in `down'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1065:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:500:in `migrate_plugin'
/opt/redmine/lib/redmine/plugin.rb:441:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:452:in `migrate'
/opt/redmine/lib/tasks/redmine.rake:151:in `block (3 levels) in <top (required)>'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'

Caused by:
NoMethodError: undefined method `delete' for nil:NilClass
/opt/redmine/plugins/redmine_indicator/db/migrate/20191221_indicator_custom_fields.rb:31:in `down'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:836:in `down'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:870:in `public_send'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:870:in `exec_migration'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:850:in `block in migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:849:in `migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1037:in `migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1382:in `ddl_transaction'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1302:in `each'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1251:in `block in migrate'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1251:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:478:in `down'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.7/lib/active_record/migration.rb:1065:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:500:in `migrate_plugin'
/opt/redmine/lib/redmine/plugin.rb:441:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:452:in `migrate'
/opt/redmine/lib/tasks/redmine.rake:151:in `block (3 levels) in <top (required)>'
/opt/redmine/vendor/bundle/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)