Defect #34255

Adding new group results in Error 500

Added by Sven Culley 7 months ago. Updated 7 months ago.

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

0%

Category:Database
Target version:-
Resolution: Affected version:4.1.1

Description

When I try to add a new group (groups/new) I get an Error 500 with the following log message

Completed 500 Internal Server Error in 15ms (ActiveRecord: 9.7ms)
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 ('', '', '', 'Group name', '2020-11-12 18:55:38', '2020-11-12 18:55:38', 'Group')):

Details regarding Redmine

Environment:
  Redmine version                4.1.1.stable
  Ruby version                   2.5.5-p157 (2019-03-15) [x86_64-linux-gnu]
  Rails version                  5.2.4.2
  Environment                    production
  Database adapter               Mysql2

Any suggestions on how to get this fixed?

History

#1 Updated by Pavel Rosický 7 months ago

Setting.default_notification_option is probably blank for some reason? that should never happen

take a look if the default value is present in your database and config/settings.yml

any 3rd party plugins?

#2 Updated by Sven Culley 7 months ago

Code in settings.yml

default_notification_option:
  default: 'only_my_events'

Full redmine info

Environment:
  Redmine version                4.1.1.stable
  Ruby version                   2.5.5-p157 (2019-03-15) [x86_64-linux-gnu]
  Rails version                  5.2.4.2
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Git                            2.20.1
  Filesystem                     
Redmine plugins:
  additionals                    3.0.1-master
  redmine_banner                 0.3.4
  redmine_slack                  0.2
  redmine_spent_time             4.1.0
  view_customize                 2.7.0

#3 Updated by Pavel Rosický 7 months ago

what is the result of

rails c p
Setting.default_notification_option
=>

?

try it without plugins

#4 Updated by Sven Culley 7 months ago

Loading production environment (Rails 5.2.4.2)
Setting.default_notification_option
=> "only_my_events" 

Should be ok

Also available in: Atom PDF