Defect #35470
closedCreate "New Group" results in HTTP code 500
0%
Description
Redmine logs output¶
App 174 output: I, [2021-06-27T08:09:33.046085 #174] INFO -- : Started POST "/redmine/groups" for 172.30.23.1 at 2021-06-27 08:09:33 +0300 App 174 output: I, [2021-06-27T08:09:33.047230 #174] INFO -- : Processing by GroupsController#create as HTML App 174 output: I, [2021-06-27T08:09:33.047325 #174] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"XXXX", "group"=>{"name"=>"test"}, "commit"=>"Create"} App 174 output: I, [2021-06-27T08:09:33.115818 #174] INFO -- : Current user: XXXX (id=XXXX) App 174 output: I, [2021-06-27T08:09:33.123919 #174] INFO -- : Completed 500 Internal Server Error in 76ms (ActiveRecord: 66.7ms) App 174 output: F, [2021-06-27T08:09:33.125716 #174] FATAL -- : App 174 output: F, [2021-06-27T08:09:33.125742 #174] FATAL -- : ActiveRecord::NotNullViolation (Mysql2::Error: Field 'mail_notification' doesn't have a default value: INSERT INTO `users` (`login`, `hashed_password`, `firstname`, `lastname`, `created_on`, `updated_on`, `type`) VALUES ('', '', '', 'test', '2021-06-27 08:09:33', '2021-06-27 08:09:33', 'Group')): App 174 output: F, [2021-06-27T08:09:33.125773 #174] FATAL -- : App 174 output: F, [2021-06-27T08:09:33.125792 #174] FATAL -- : app/controllers/groups_controller.rb:68:in `block in create' App 174 output: app/controllers/groups_controller.rb:67:in `create' App 174 output: lib/redmine/sudo_mode.rb:61:in `sudo_mode'
Redmine info¶
Running official Docker image without modifications (https://hub.docker.com/_/redmine/).
We have 3 plugins, info listed below.
Environment: Redmine version 4.2.1.stable Ruby version 2.7.3-p183 (2021-04-05) [x86_64-linux] Rails version 5.2.5 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Subversion 1.10.4 Mercurial 4.8.2 Bazaar 2.8.0 Git 2.20.1 Filesystem Redmine plugins: redmine_checklists 3.1.18 redmine_contacts 4.3.2 redmineup_tags 2.0.8
Our Redmine DB exists from 2011 (from 1.x to 4.x).
Setting.default_notification_option check:
root@redmine:/usr/src/redmine# rails c p Loading production environment (Rails 5.2.5) irb(main):001:0> Setting.default_notification_option => "only_my_events"
Notes¶
The same issue occurred in Redmine 3.x prior to migration to 4.2.1
Related issues: #34255
Updated by Go MAEDA over 3 years ago
Can you please check if the error occurs without plugins?
Updated by Holger Just over 3 years ago
- Status changed from New to Needs feedback
Please also make sure that you have applied all pending database migrations. See RedmineUpgrade for details.
Updated by Marius BĂLTEANU almost 3 years ago
- Status changed from Needs feedback to Closed
- Resolution set to Cant reproduce
Closing this until we get more details.
Updated by Andreas Hengsbach almost 3 years ago
I ran into the same problem.
The INSERT statement above does not provide a value for the field mail_notification
:INSERT INTO `users` (`login`, `hashed_password`, `firstname`, `lastname`, `created_on`, `updated_on`, `type`) VALUES ('', '', '', 'test', '2021-06-27 08:09:33', '2021-06-27 08:09:33', 'Group')
So the default value is used.
And then... drumroll: Mysql2::Error: Field 'mail_notification' doesn't have a default value
I saw, that all existing users with type = "Group" has the value "" (Emtpy string) in the field mail_notification
.
So I created a default value directly on the database: ALTER TABLE users ALTER mail_notification SET DEFAULT "";
That works for me - so far.
But I've no idea why the default value was missing and who's responsible for that.
FYI:
Environment: Redmine version 4.2.3.stable Ruby version 2.6.6-p146 (2020-03-31) [x86_64-linux-gnu] Rails version 5.2.6 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Subversion 1.13.0 Mercurial 5.3.1 Cvs 1.12.13 Bazaar 3.0.2 Git 2.33.1 Filesystem Redmine plugins: redmine_agile 1.6.2 redmine_resources 1.0.6
Edit: As I just see Mark Tomm also uses RedmineUp plugins. Maybe it is related to this.
Updated by C S almost 3 years ago
Try without the Plugins from redmineup (i also have many problems with plugins from them)
Updated by Dimitar (RedmineUP) about 2 years ago
Dear Mark,
This is Dimitar from the RedmineUP Support Team.
I see that you have some of our plugins on your list:
redmine_checklists 3.1.18 redmine_contacts 4.3.2 redmineup_tags 2.0.8
So, could you please contact our support team at support@redmineup.com? And our support engineers will help you investigate the situation.
We look forward to hearing from you.
Best Regards,
Dimitar from the RedmineUP Support Team
Mark Tomm wrote:
Redmine logs output¶
[...]
Redmine info¶
Running official Docker image without modifications (https://hub.docker.com/_/redmine/).
We have 3 plugins, info listed below.[...]
Our Redmine DB exists from 2011 (from 1.x to 4.x).
Setting.default_notification_option check:
[...]
Notes¶
The same issue occurred in Redmine 3.x prior to migration to 4.2.1
Related issues: #34255
Updated by Dimitar (RedmineUP) about 2 years ago
Dear CS,
Please contact us at support@redmineup.com and our support team will help you solve all your problems with the plugins. :)
We look forward to hearing from you.
Best Regards,
Dimitar from the RedmineUP Support Team
C S wrote:
Try without the Plugins from redmineup (i also have many problems with plugins from them)