将数据迁移到新实例 3.2 -> 4.0 后 Redmine 500 错误

问题描述

我正在尝试将我的数据从旧的 redmine (3.2) 实例迁移到新的实例 (4.0)。

我的新redmine服务器运行的是ubuntu 20.04,配置如下

Environment:
  Redmine version                4.0.6.stable
  Ruby version                   2.7.0-p0 (2019-12-25) [x86_64-linux-gnu]
  Rails version                  5.2.3
  Environment                    production
  Database adapter               MysqL2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Git                            2.25.1
  Filesystem                     
Redmine plugins:
  no plugin installed

我按照 https://computingforgeeks.com/install-redmine-on-ubuntu-linux/ 创建了它。

移动数据库后,我运行 RAILS_ENV=production bundle exec rake db:migrate 以执行任何必要的迁移,这些迁移似乎成功执行,尽管它确实报告了一些警告 (https://pastebin.com/yzNpHiKm) - 我不确定它们是相关的,因为我对 ruby​​ 了解不多。

我可以看到我所有的旧票都在那里等等,但是当我尝试查看一张或创建一张新票时,它会抛出 500,并在日志中报告以下内容

Completed 500 Internal Server Error in 205ms (ActiveRecord: 21.3ms)

ActionView::Template::Error (undefined method `accessor' for #<ActiveModel::Type::Value:0x00005625fa76b6c0>):
    15: <% end %>
    16:
    17: <% if @issue.safe_attribute? 'assigned_to_id' %>
    18: <p><%= f.select :assigned_to_id,principals_options_for_select(@issue.assignable_users,@issue.assigned_to),:include_blank => true,:required => @issue.required_attribute?('assigned_to_id') %></p>
    19: <% end %>
    20:
    21: <% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>

app/models/role.rb:223:in `permissions_all_trackers'
app/models/role.rb:232:in `permissions_all_trackers?'
app/models/role.rb:238:in `permissions_tracker?'
app/models/project.rb:554:in `block in assignable_users'
app/models/project.rb:554:in `assignable_users'
app/models/issue.rb:934:in `assignable_users'
app/views/issues/_attributes.html.erb:18:in `block in _app_views_issues__attributes_html_erb___775154800353400985_73440'
app/helpers/application_helper.rb:1249:in `labelled_fields_for'
app/views/issues/_attributes.html.erb:1:in `_app_views_issues__attributes_html_erb___775154800353400985_73440'
app/views/issues/_form.html.erb:44:in `block in _app_views_issues__form_html_erb___962050841117096496_73420'
app/helpers/application_helper.rb:1249:in `labelled_fields_for'
app/views/issues/_form.html.erb:1:in `_app_views_issues__form_html_erb___962050841117096496_73420'
app/views/issues/_edit.html.erb:8:in `block in _app_views_issues__edit_html_erb___2491441640301013004_73400'
app/helpers/application_helper.rb:1242:in `labelled_form_for'
app/views/issues/_edit.html.erb:1:in `_app_views_issues__edit_html_erb___2491441640301013004_73400'
app/views/issues/_action_menu_edit.html.erb:8:in `_app_views_issues__action_menu_edit_html_erb__2036666379799696235_73380'
app/views/issues/show.html.erb:139:in `_app_views_issues_show_html_erb___1022264146824026390_73240'
app/controllers/issues_controller.rb:107:in `block (2 levels) in show'
app/controllers/issues_controller.rb:100:in `show'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

如前所述,我不是 ruby​​/rails 专家,但据我所知,这似乎不是 redmine 的问题——而是我的 ruby​​/rails 配置。

当我重新运行 RAILS_ENV=production bundle exec rake db:migrate 时,我收到以下警告

/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/associations.rb:1855: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/associations.rb:1368: warning: The called method `has_many' is defined here
/usr/share/rubygems-integration/all/gems/actionpack-5.2.3/lib/action_dispatch/middleware/stack.rb:37: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/actionpack-5.2.3/lib/action_dispatch/middleware/static.rb:111: warning: The called method `initialize' is defined here
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/MysqL/database_statements.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/query_cache.rb:95: warning: The called method `select_all' is defined here
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:260: warning: The called method `transaction' is defined here
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:171: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:97: warning: The called method `initialize' is defined here
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/persistence.rb:705: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/timestamp.rb:105: warning: The called method `_update_record' is defined here
/usr/share/rubygems-integration/all/gems/activemodel-5.2.3/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activemodel-5.2.3/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/MysqL/schema_statements.rb:44: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/schema_deFinitions.rb:11: warning: The called method `initialize' is defined here

感谢任何指点。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)