Error to create a new group

Added by adrian perez 3 months ago

Hello colleagues,

I have problems after migrating and updating Redmine from 2.4 to 4.2.

This Redmine was moved from one server to another. Now in version 4.2 I get the following error when creating new user groups (attached screenshots and log captured in a local simulation environment).

Error:

Logs:

I, [2021-10-27T14:01:11.796410 #1]  INFO -- : Started POST "/groups" for 172.24.0.1 at 2021-10-27 14:01:11 +0000
I, [2021-10-27T14:01:11.802568 #1]  INFO -- : Processing by GroupsController#create as HTML
I, [2021-10-27T14:01:11.802685 #1]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"h+MO4bvw/zx4uAs98ATXo4x7Pxo6wolvswQ3ouJY13Bc5eDD19S5hwqLQzFSj9D7mFpNfyGPUqlXeMrDPcLANQ==", "group"=>{"name"=>"testNewGroupCreate"}, "commit"=>"Crear"}
I, [2021-10-27T14:01:11.830214 #1]  INFO -- :   Current user: adrianperez (id=107)
I, [2021-10-27T14:01:11.835748 #1]  INFO -- : Completed 500 Internal Server Error in 33ms (ActiveRecord: 26.2ms)
F, [2021-10-27T14:01:11.836816 #1] FATAL -- :   
F, [2021-10-27T14:01:11.836854 #1] FATAL -- : ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR:  null value in column "mail_notification" violates not-null constraint
DETAIL:  Failing row contains (126, , , , testNewGroupCreate, f, 1, null, null, null, 2021-10-27 14:01:11.833773, 2021-10-27 14:01:11.833773, Group, null, null, null, f, null, null, null, null).
: INSERT INTO "users" ("login", "hashed_password", "firstname", "lastname", "created_on", "updated_on", "type") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id"):
F, [2021-10-27T14:01:11.836878 #1] FATAL -- :   
F, [2021-10-27T14:01:11.836901 #1] FATAL -- : app/controllers/groups_controller.rb:68:in `block in create'
app/controllers/groups_controller.rb:67:in `create'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'

Version information:

How can the error be solved? Any suggestion? tip? idea?

Thanks in advance for your help. Greetings.

Redmine500error.png (20.8 KB)

info.png (23.6 KB)

Replies (1)

RE: Error to create a new group - Added by adrian perez 3 months ago

Solve it with:
1) ALTER TABLE users ALTER mail_notification SET DEFAULT '';
2) rake db:migrate
3) Restart service.

Source: https://blog.n-z.jp/blog/2014-01-12-taps-trouble.html

(1-1/1)