Defect #22119

Error: Data too long for column 'notes' when copy paste pictures

Added by Thomas Koch over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:-
Resolution:Duplicate Affected version:3.2.0

Description

I was copy&pasting some text with an Picture to the Issue notes. It gave me an awesome (working) preview, but a Redmine 500 error while saving (Internal error page was shown). My log-file reads:

ActiveRecord::StatementInvalid (Mysql2::Error: Data too long for column 'notes' at row 1: INSERT INTO `journals` (`journalized_id`, `journalized_type`, `user_id`, `notes`, `created_on`) VALUES (8127, 'Issue', 104, '<p><img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAl0AAADuCAYAAAADQ7LZAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAA...

...CYII=\" /></p>\r\n', '2016-02-29 10:11:41')):
  app/models/journal.rb:67:in `save'
  app/models/issue.rb:1659:in `create_journal'
  app/models/issue.rb:182:in `create_or_update'
  app/controllers/issues_controller.rb:487:in `block in save_issue_with_child_records'
  app/controllers/issues_controller.rb:475:in `save_issue_with_child_records'
  app/controllers/issues_controller.rb:180:in `update'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'


Related issues

Related to Redmine - Feature #31921: Changes to properly support 4 byte characters (emoji) whe... Closed
Duplicates Redmine - Feature #19869: Consider increasing the size limit of description and not... Closed

History

#1 Updated by Go MAEDA over 4 years ago

What is the size of the text and what database do you use?
I guess the text is longer than 64KB and the database is MySQL.

#2 Updated by Thomas Koch over 4 years ago

Yes, Mysql (as the error shows as well)
I do not know the size of that image, but I guess it will be more the 64kB.

#3 Updated by Go MAEDA over 4 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

The size of issue.descpiption and journal.notes are limited to 64KB on MySQL for now.
Closing this issue as a duplicate of #19869.

#4 Updated by Go MAEDA over 4 years ago

  • Duplicates Feature #19869: Consider increasing the size limit of description and note columns for tickets added

#5 Updated by Thomas Koch over 4 years ago

Converting the whole database from utf8 to utf8mb4 solve this issue! (see: #21398)

The data type of all text fields got automatically changed from text to mediumtext, which can hold up to 16MB!

Redmine should catch this exception and give more details. Same here: #21398!

#6 Updated by Marius BALTEANU 11 months ago

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

Also available in: Atom PDF