Checklists plugin fails on non-unicode items add

Added by Alexander Bazhenov 6 months ago

Hi, i just tried redmine_checklists-3_1_18-light plugin ( https://www.redmine.org/plugins/redmine_checklists ) plugin and it's broken on non-uicode checklist item add:

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

while it's working in a demo ( http://demo.redmineup.com/projects/agile/agile/board?query_id=4 ). I have checked nginx error log and found the next lines:

App 19293 output: ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xD0\xA7\xD0\xB5\xD0\xBA...' for column 'subject' at row 1: INSERT INTO `checklists` (`subject`, `issue_id`, `created_at`, `updated_at`) VALUES ('Чеклист', 8810, '2021-04-09 16:54:03', '2021-04-09 16:54:03')):
App 19293 output:   app/models/issue.rb:210:in `create_or_update'
App 19293 output:   app/controllers/issues_controller.rb:563:in `block in save_issue_with_child_records'
App 19293 output:   app/controllers/issues_controller.rb:551:in `save_issue_with_child_records'
App 19293 output:   app/controllers/issues_controller.rb:168:in `update'
App 19293 output:   lib/redmine/sudo_mode.rb:63:in `sudo_mode'

I have also tried all commands like:

bundle install --without development test --no-deployment
bundle exec rake redmine:plugins NAME=redmine_checklists RAILS_ENV=production
rake redmine:plugins:migrate RAILS_ENV=production
rake db:migrate_plugins RAILS_ENV=production

Our environment:

Environment:
  Redmine version                3.4.6.stable.17477
  Ruby version                   2.2.5-p319 (2016-04-26) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.9.3
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  redmine_agile                  1.6.0
  redmine_checklists             3.1.18
  redmine_custom_css             0.1.7
  redmine_issues_tree            0.0.12
  redmineup_tags                 2.0.3
  time_logger                    0.5.4
actionmailer (4.2.8)
actionpack (4.2.8)
actionpack-xml_parser (1.0.2)
actionview (4.2.8)
activejob (4.2.8)
activemodel (4.2.8)
activerecord (4.2.8)
activesupport (4.2.8)
addressable (2.5.2)
arel (6.0.4)
bigdecimal (default: 1.2.6)
builder (3.2.4, 3.2.3)
bundler (1.17.3, default: 1.16.6, 1.16.4)
bundler-unload (1.0.2)
coderay (1.1.2)
concurrent-ruby (1.1.8, 1.0.5)
crass (1.0.6, 1.0.4)
css_parser (1.6.0)
erubis (2.7.0)
executable-hooks (1.3.2)
gem-wrappers (1.4.0, 1.2.7)
globalid (0.4.2, 0.4.1)
haml (5.0.4)
haml-rails (1.0.0)
html2haml (2.2.0)
htmlentities (4.3.4)
i18n (0.7.0)
io-console (default: 0.4.3)
jquery-rails (3.1.5)
json (default: 1.8.1)
liquid (2.6.3)
loofah (2.9.0, 2.2.2)
mail (2.6.6)
mime-types (3.3.1, 3.2.2)
mime-types-data (3.2021.0225, 3.2018.0812)
mimemagic (0.3.2)
mini_portile2 (2.3.0)
minitest (5.14.4, 5.11.3)
mysql2 (0.4.10)
net-ldap (0.12.1)
nokogiri (1.8.5, 1.8.4)
passenger (5.3.4)
protected_attributes (1.1.4)
psych (default: 2.0.8)
public_suffix (3.0.3)
rack (2.0.5, 1.6.13, 1.6.10)
rack-openid (1.4.2)
rack-test (0.6.3)
rails (4.2.8)
rails-deprecated_sanitizer (1.0.4, 1.0.3)
rails-dom-testing (1.0.9)
rails-html-sanitizer (1.3.0, 1.0.4)
railties (4.2.8)
rake (13.0.3, 12.3.1, default: 10.4.2)
rbpdf (1.19.5)
rbpdf-font (1.19.1)
rdoc (default: 4.2.0)
redcarpet (3.4.0)
redmine_crm (0.0.54, 0.0.38)
request_store (1.0.5)
require_patch (0.3.3)
rmagick (2.16.0)
roadie (3.2.2)
roadie-rails (1.1.1)
ruby-openid (2.3.0)
ruby_parser (3.11.0)
rubygems-bundler (1.4.4)
rubygems-update (2.7.11)
rubyzip (1.2.2)
rvm (1.11.3.9)
sexp_processor (4.11.0)
sprockets (3.7.2)
sprockets-rails (3.2.2, 3.2.1)
temple (0.8.0)
thor (1.1.0, 0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
tzinfo (1.2.9, 1.2.5)

Any ideas how to resolve this?

Thanks in advance for any info.
Regards, Alexander.

Replies (1)

RE: Checklists plugin fails on non-unicode items add - Added by Alexander Bazhenov 6 months ago

Doesn't matter what version you have install, the problem is in mysql table encoding. Database migration and plugins migrations

bundle exec rake db:migrate RAILS_ENV=production 
bundle exec rake tmp:cache:clear RAILS_ENV=production

didn't helped. Running next commands:

mysql -uroot -p
USE redmine;
ALTER TABLE checklists CHANGE subject subject VARCHAR(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

solved my issue.

May be I should config the whole database like utf8mb4 in config/database.yml then perform database migration, but I didn't tested this method.

(1-1/1)