akiko-pusu / redmine_issue_templates

Maintenance Repository - https://github.com/agileware-jp/redmine_issue_templates
https://www.redmine.org/plugins/redmine_issue_templates
GNU General Public License v2.0
199 stars 121 forks source link

Creating notes with inline images drops error 500 #365

Closed ChrisUHZ closed 4 years ago

ChrisUHZ commented 4 years ago

We create note templates with inline images (ckeditor html). If i create templates with more than three images and try to save them, i will get a server error 500. Some logfile searching later, i find the solution to fix it.

Environment

Redmine version 4.0.5.stable Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux-gnu] Rails version 5.2.3 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Subversion 1.9.5 Git 2.11.0 Filesystem
Redmine plugins: redmine_checklists 3.1.17 redmine_ckeditor 1.2.3 redmine_contacts 4.3.0 redmine_contacts_helpdesk 4.1.8 redmine_issue_badge 0.1.3 redmine_issue_templates 1.0.4 redmine_lightbox2 0.5.1 redmine_questions 1.0.2

Workaround

phpmyadmin -> table note_templates, change description type to longtext.

Would be nice if you change the type for description in the table for further updating your script ;-)

akiko-pusu commented 4 years ago

Hi, thanks for your report.

The problem related to this issue was resolved on commit: d79fdee and included in release v1.0.1.

If you installed the latest version of this plugin and ran the migration script correctly, the type of column would be changed. Did you run the migration task?

I recommend you to confirm the migration status for the issue template. As I wrote README, run this command as SQL command:

select * from schema_migrations where version like '%redmine_issue_templates%';

Maybe you can run the SQL command via rails dbconsole.

redmine $ rails dbconsole
SQLite version 3.28.0 2019-04-15 14:49:49
Enter ".help" for usage hints.
sqlite> select * from schema_migrations where version like '%redmine_issue_templates%';
1-redmine_issue_templates
2-redmine_issue_templates
3-redmine_issue_templates
4-redmine_issue_templates
2014020191500-redmine_issue_templates
20121208150810-redmine_issue_templates
20130630141710-redmine_issue_templates
20130701024625-redmine_issue_templates
20140307024626-redmine_issue_templates
20140312054531-redmine_issue_templates
20140330155030-redmine_issue_templates
20160727222420-redmine_issue_templates
20160828190000-redmine_issue_templates
20160829001500-redmine_issue_templates
20160829001530-redmine_issue_templates
20170317082100-redmine_issue_templates
20181104065200-redmine_issue_templates
20190303082102-redmine_issue_templates
20190714171020-redmine_issue_templates
20190714211530-redmine_issue_templates
20200101204020-redmine_issue_templates
20200101204220-redmine_issue_templates
20200102204815-redmine_issue_templates
20200102205044-redmine_issue_templates
20200103213630-redmine_issue_templates
20200115073600-redmine_issue_templates
20200314132500-redmine_issue_templates  # This is the record related to this issue.
20200405115700-redmine_issue_templates
20200405120700-redmine_issue_templates
20200418114157-redmine_issue_templates

Change the column type manually is a part of the workaround. But all the records related to the migration tasks should be present. If not, when next time you run the migration task, the migration might fail.