Project

General

Profile

Wiki diff error after upgrade

Added by Nikolay Boyukliev about 9 years ago

After upgrading from Redmine 2 to Redmine version 3.0.4.stable it was noticed that we are getting error when trying to view the history of the wiki pages that was created in the earlier versions:

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

Back

The environment is:

Environment:
  Redmine version                3.0.4.stable
  Ruby version                   2.1.6-p336 (2015-04-13) [x86_64-linux-gnu]
  Rails version                  4.2.3
  Environment                    production
  Database adapter               Mysql2

And the error I'm getting in the production.log is:

Processing by WikiController#history as HTML
  Parameters: {"project_id"=>"fc-support-tbv", "id"=>"Wiki"}
  Current user: nikibo (id=8)
  Rendered wiki/history.html.erb within layouts/base (7.5ms)
Completed 200 OK in 26ms (Views: 18.0ms | ActiveRecord: 1.5ms)
Started GET "/projects/fc-support-tbv/wiki/Wiki/diff?utf8=%E2%9C%93&version=3&version_from=2&commit=View+differences" for 172.16.51.121 at 2015-11-03 17:43:50 +0200
Processing by WikiController#diff as HTML
  Parameters: {"utf8"=>"✓", "version"=>"3", "version_from"=>"2", "commit"=>"View differences", "project_id"=>"fc-support-tbv", "id"=>"Wiki"}
  Current user: nikibo (id=8)
Completed 500 Internal Server Error in 7ms (ActiveRecord: 0.6ms)

NoMethodError (undefined method `force_encoding' for nil:NilClass):
  app/models/wiki_content.rb:110:in `text'
  app/models/wiki_page.rb:255:in `initialize'
  app/models/wiki_page.rb:164:in `new'
  app/models/wiki_page.rb:164:in `diff'
  app/controllers/wiki_controller.rb:224:in `diff'

Please advise how to approach to issue and resolve it.