Project

General

Profile

Actions

Defect #1508

closed

500 Internal Server Error when creating issue note template

Added by Ivan Cenov 4 months ago. Updated 4 months ago.

Status:
却下(Invalid)
Priority:
通常(Normal)
Assignee:
-
Target version:
-
Start date:
01/19/2021
Due date:
% Done:

0%

Estimated time:

Description

Summary

+500 Internal Server Error when creating issue note template containing Cyrillic

Description

This problem occurs when trying to create global issue note template that contains Cyrillic letters. After replacing these letters with English ones the problem does not appear anymore. This problem occurs when creating issue note template in a project too.

Environment

Environment:
  Redmine version                4.1.1.stable
  Ruby version                   2.6.5-p114 (2019-10-01) [x64-mingw32]
  Rails version                  5.2.4.2
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Subversion                     1.8.19
  Git                            2.25.1
  Filesystem                     
Redmine plugins:
  additional_tags                1.0.0
  additionals                    3.0.2-master
  redmine_code_review            1.0.0
  redmine_issue_templates        1.1.0
  redmine_latex_mathjax          0.4.0
  redmine_theme_changer          0.4.0

Visual Proof / Screenshot

Here is log:

Started POST "/global_note_templates" for 192.168.20.177 at 2021-01-19 12:50:12 +0200
Processing by GlobalNoteTemplatesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"uKBq6Ar8dTk5u2CNxzdvHx9jb7HGbEIySyhj4Axb0wvaHEQukv1eH7s/OSa93UPC71fA/FOi6Tu/1UOusnlnZg==", "global_note_template"=>{"name"=>"Отпускане на материал без изписване", "tracker_id"=>"2", "description"=>"\r\n|=. Склад |=. 1711 |\r\n|=. Ид. № |=. 000000 |\r\n|=. Име |=. |\r\n|=. Партида/дата |=. |\r\n|=. Налично в склада |=. |\r\n|=. Дадено в цех |=. |\r\n|=. Дата на даване в цех |=. 20.01.2021 |\r\n\r\n|=. Употребено |=. |\r\n|=. Върнато в склад |=. |\r\n|=. Дата на връщане |=. 20.01.2021 |", "visibility"=>"open", "memo"=>"", "enabled"=>"1", "project_ids"=>["437", ""]}, "commit"=>"Създаване"}
  Current user: imc (id=3)
Completed 500 Internal Server Error in 24ms (ActiveRecord: 7.1ms)

ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xD0\x9E\xD1\x82\xD0\xBF...' for column 'name' at row 1: INSERT INTO `global_note_templates` (`name`, `description`, `memo`, `tracker_id`, `author_id`, `enabled`, `position`, `created_at`, `updated_at`) VALUES ('Отпускане на материал без изписване', '\r\n|=. Склад |=. 1711 |\r\n|=. Ид. № |=. 000000 |\r\n|=. Име |=. |\r\n|=. Партида/дата |=. |\r\n|=. Налично в склада |=. |\r\n|=. Дадено в цех |=. |\r\n|=. Дата на даване в цех |=. 20.01.2021 |\r\n\r\n|=. Употребено |=. |\r\n|=. Върнато в склад |=. |\r\n|=. Дата на връщане |=. 20.01.2021 |', '', 2, 3, TRUE, 1, '2021-01-19 12:50:12', '2021-01-19 12:50:12')):

plugins/redmine_issue_templates/app/controllers/global_note_templates_controller.rb:76:in `save_and_flash'
plugins/redmine_issue_templates/app/controllers/global_note_templates_controller.rb:39:in `create'
lib/redmine/sudo_mode.rb:65:in `sudo_mode'
Started POST "/global_note_templates" for 192.168.20.177 at 2021-01-19 12:52:24 +0200
Processing by GlobalNoteTemplatesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"uKBq6Ar8dTk5u2CNxzdvHx9jb7HGbEIySyhj4Axb0wvaHEQukv1eH7s/OSa93UPC71fA/FOi6Tu/1UOusnlnZg==", "global_note_template"=>{"name"=>"Lease material", "tracker_id"=>"2", "description"=>"\r\n|=. Склад |=. 1711 |\r\n|=. Ид. № |=. 000000 |\r\n|=. Име |=. |\r\n|=. Партида/дата |=. |\r\n|=. Налично в склада |=. |\r\n|=. Дадено в цех |=. |\r\n|=. Дата на даване в цех |=. 20.01.2021 |\r\n\r\n|=. Употребено |=. |\r\n|=. Върнато в склад |=. |\r\n|=. Дата на връщане |=. 20.01.2021 |", "visibility"=>"open", "memo"=>"", "enabled"=>"1", "project_ids"=>["437", ""]}, "commit"=>"Създаване"}
  Current user: imc (id=3)
Completed 500 Internal Server Error in 28ms (ActiveRecord: 7.2ms)

ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xD0\xA1\xD0\xBA\xD0\xBB...' for column 'description' at row 1: INSERT INTO `global_note_templates` (`name`, `description`, `memo`, `tracker_id`, `author_id`, `enabled`, `position`, `created_at`, `updated_at`) VALUES ('Lease material', '\r\n|=. Склад |=. 1711 |\r\n|=. Ид. № |=. 000000 |\r\n|=. Име |=. |\r\n|=. Партида/дата |=. |\r\n|=. Налично в склада |=. |\r\n|=. Дадено в цех |=. |\r\n|=. Дата на даване в цех |=. 20.01.2021 |\r\n\r\n|=. Употребено |=. |\r\n|=. Върнато в склад |=. |\r\n|=. Дата на връщане |=. 20.01.2021 |', '', 2, 3, TRUE, 1, '2021-01-19 12:52:24', '2021-01-19 12:52:24')):

plugins/redmine_issue_templates/app/controllers/global_note_templates_controller.rb:76:in `save_and_flash'
plugins/redmine_issue_templates/app/controllers/global_note_templates_controller.rb:39:in `create'
lib/redmine/sudo_mode.rb:65:in `sudo_mode'

Expected Results

Created new template

Actual Results

500 Internal server error

Workaround

Using only English letters - where it is possible.

Actions

Also available in: Atom PDF