Defect #35430

Internal error when viewing revisions diff

Added by salman mp 3 months ago. Updated about 1 month ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-
Resolution: Affected version:4.1.2

Description

When I want to view revisions diff in the one project repository tab, in the first try it is OK, but after refresh or try another revisions diff it throw internal server error 500.
I found that is because of using any deface on 'layout/base'.

History

#1 Updated by Holger Just 3 months ago

  • Status changed from New to Needs feedback

Please see Submissions.

When reporting a bug, we need details about your environment and a full stack trace. If you are using any plugins. please confirm that the issue is caused by Redmine core and is still observable after you have removed all plugins.

#2 Updated by salman mp 3 months ago

This is my "info":

Environment:
  Redmine version                4.1.1.stable
  Ruby version                   2.5.7-p206 (2019-10-01) [x86_64-linux]
  Rails version                  5.2.4.2
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                sendmail
SCM:
  Subversion                     1.13.0
  Mercurial                      5.3.1
  Git                            2.25.1
  Filesystem                     
Redmine plugins:
  redmine_scm                    0.6.0
  my_plugin                      0.0.1 (Using Deface to change layout/base)

and production log:

Processing by RepositoriesController#diff as HTML
  Parameters: {"utf8"=>"✓", "rev_to"=>"1a484b55d58e9c06ff497e0459bd9a4e5ec6c599", "type"=>"inline", "repository_id"=>"5", "rev"=>"334c0372bd11c4677a16bfd3f8d83106c0dfc5f4"}
  Current user: redmine (id=1)
  Rendering repositories/diff.html.erb within layouts/base
  Rendered repositories/diff.html.erb within layouts/base (14.0ms)
Completed 500 Internal Server Error in 405ms (ActiveRecord: 21.1ms)

ActionView::Template::Error (undefined method `encoding' for nil:NilClass):

#3 Updated by Go MAEDA 3 months ago

Does the error occur without plugins?

#4 Updated by Liane Hampe 3 months ago

I have observed the same error but could figure out that the reason is located in gem deface.

As long as we use Rails 5.2 we need to use deface 1.6.2 because higher versions consider some changes in Rails 6. Although the deface people try to be backward compatible there seems to be an edge case in combination with the diff template.

#5 Updated by salman mp about 1 month ago

Go MAEDA wrote:

Does the error occur without plugins?

No, even when using plugins without any deface on 'layout/base', there is no problem.

#6 Updated by Mischa The Evil about 1 month ago

salman mp wrote:

Go MAEDA wrote:

Does the error occur without plugins?

No, even when using plugins without any deface on 'layout/base', there is no problem.

This does not exclude the 'redmine_scm' plugin from being the culprit of your problem. You should check if your problem persists when Redmine is running without any plugins.

#7 Updated by salman mp about 1 month ago

Mischa The Evil wrote:

salman mp wrote:

Go MAEDA wrote:

Does the error occur without plugins?

No, even when using plugins without any deface on 'layout/base', there is no problem.

This does not exclude the 'redmine_scm' plugin from being the culprit of your problem. You should check if your problem persists when Redmine is running without any plugins.

If I understand what you mean, I have to admit, since I do not have the SVN code repository available, I can only test with this redmine_scm plugin. However, I only get an error if a plugin defaced 'layout/base' and Redmine is running in production mode.

Also available in: Atom PDF