Project

General

Profile

Actions

Defect #27238

closed

Mysql Error after upgrading Redmine from 2.5 to 3.*

Added by Wojciech Szychta over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Hi,

I wanted to upgrade redmine directly from 2.5.2 to 3.4. After successfully upgrade I discovered errors while creating and editing new issues.
I have also tried upgrade my redmine instalation from 2.5.2 to svn 2.6 and later to svn 3.0.
After second upgrade I have discovered that I can't modify any issue in redmine.

With Ruby 2.4.0 errors are the same.

Mysql errors looks like this:

Completed 500 Internal Server Error in 129ms (ActiveRecord: 107.5ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Result consisted of more than one row: UPDATE `issues` SET lft = CASE WHEN lft > 1 THEN lft - 2 ELSE lft END, rgt = CASE WHEN rgt > 1 THEN rgt - 2 ELSE rgt END WHERE `issues`.`root_id` = 7158 AND (lft > 1 OR rgt > 1)):
lib/redmine/nested_set/issue_nested_set.rb:126:in `destroy_children'
app/models/issue.rb:226:in `destroy'
app/controllers/issues_controller.rb:389:in `block in destroy'
app/controllers/issues_controller.rb:387:in `each'
app/controllers/issues_controller.rb:387:in `destroy'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

I also see errors when I create new issue and add polish letters in any field:

Completed 500 Internal Server Error in 117ms (ActiveRecord: 67.8ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xC4\x85\xC4\x87\xC4\x87' for column 'subject' at row 1: INSERT INTO `issues` (`project_id`, `author_id`, `tracker_id`, `status_id`, `subject`, `description`, `priority_id`, `updated_on`, `created_on`, `lock_version`) VALUES (75, 95, 2, 1, 'ąćć', 'żńó', 2, '2017-10-20 12:05:53', '2017-10-20 12:05:53', 0)):
app/models/issue.rb:212:in `create_or_update'
app/controllers/issues_controller.rb:129:in `create'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

My enviroment:
  • Redmine version 3.0.7 (upgraded from 2.5.2)
  • Ruby 1.9.3 from RVM
  • Ruby Passanger 5.1.10
  • HTTPD 2.4.6-67.el7.centos.5
  • CentOS 7
  • mysql-community-server 5.5.57-2.el7
Environment:
  • Redmine version 3.0.7.stable.17016
  • Ruby version 1.9.3-p551 (2014-11-13) [x86_64-linux]
  • Rails version 4.2.3
  • Environment production
  • Database adapter Mysql2
  • Ruby Passanger 5.1.10
  • HTTPD 2.4.6-67.el7.centos.5
  • CentOS 7
  • mysql-community-server 5.5.57-2.el7
SCM:
  • Subversion 1.7.14
  • Git 1.8.3.1
  • Filesystem
Redmine plugins:
  • redmine_bootstrap_kit 0.2-devel
  • redmine_issue_templates 0.1.8
  • redmine_spent_time 3.1.2

Related issues

Related to Redmine - Feature #31921: Changes to properly support 4 byte characters (emoji) when database is MySQLClosedGo MAEDA

Actions
Actions #1

Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from New to Closed
  • Priority changed from High to Normal
  • Resolution set to Invalid

Redmine 3.0.7 is not maintained.
AFAIW, CentOS 5 is end of life.

Wojciech Szychta wrote:

@Completed 500 Internal Server Error in 117ms (ActiveRecord: 67.8ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xC4\x85\xC4\x87\xC4\x87' for column 'subject' at row 1: INSERT INTO `issues` (`project_id`, `author_id`, `tracker_id`, `status_id`, `subject`, `description`, `priority_id`, `updated_on`, `created_on`, `lock_version`) VALUES (75, 95, 2, 1, 'ąćć', 'żńó', 2, '2017-10-20 12:05:53', '2017-10-20 12:05:53', 0)):

https://www.google.com/search?q=mysql+utf8+latin1

Actions #2

Updated by Wojciech Szychta over 6 years ago

  • Status changed from Closed to Reopened
I wanted to upgrade redmine directly from 2.5.2 to 3.4. After successfully upgrade I discovered errors while creating and editing new issues.

It was my first sentence. The problem is with Redmine 3.0 and 3.4. I was testing on with version it starts.
Environment:
* Redmine version 3.0.7.stable.17016
* Ruby version 1.9.3-p551 (2014-11-13) [x86_64-linux]
* Rails version 4.2.3
* Environment production
* Database adapter Mysql2
* Ruby Passanger 5.1.10
* HTTPD 2.4.6-67.el7.centos.5
* CentOS 7
* mysql-community-server 5.5.57-2.el7

My system is CentOS 7 not 5 and I wrote that earlier.
In documentation is exactly specified what type of encoding must be set to database http://www.redmine.org/projects/redmine/wiki/RedmineInstall#MySQL.
UTF-8 encoding supports polish letters. In redmine 2.5.2 it works well and after upgrading it stop working.

First error has nothing in common with encoding. As you can see this is problem with Mysql Update:

Mysql2::Error: Result consisted of more than one row: UPDATE

Actions #3

Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from Reopened to Closed

You need to convert your latin1 database to utf8.

Actions #4

Updated by Toshi MARUYAMA over 6 years ago

Wojciech Szychta wrote:

First error has nothing in common with encoding. As you can see this is problem with Mysql Update:
[...]

It seems your issue tree is broken.

Anyway, these are your environment problems.
Please use forum for question.
We don't provide any technical support.

Actions #5

Updated by Marius BĂLTEANU over 4 years ago

  • Related to Feature #31921: Changes to properly support 4 byte characters (emoji) when database is MySQL added
Actions

Also available in: Atom PDF