Project

General

Profile

Actions

Defect #40181

closed

[Redmine] Mysql2 error Unknown column 'roles.default_time_entry_activity_id'

Added by ye htut naung 8 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

We are trying to migrate bitnami redmine version from 4.2.3-3 (windows) to 5.1.0 (aws debian).

We encountered the below error after database migration is done, when I tried to open issue details page:

I, [2024-01-24T09:24:34.639886 #240559] INFO -- : [c95baa9a-2553-4306-826a-64c5b21aaa3c] Rendered layout layouts/base.html.erb (Duration: 97.4ms | Allocations: 61719)
I, [2024-01-24T09:24:34.640311 #240559] INFO -- : [c95baa9a-2553-4306-826a-64c5b21aaa3c] Completed 200 OK in 172ms (Views: 90.2ms | ActiveRecord: 31.9ms | Allocations: 88284)
I, [2024-01-24T09:24:38.426255 #240559] INFO -- : [6733bddb-7979-4643-9523-58dc9d1483b1] Started GET "/issues/12114" for xx.xx.xx.xxx at 2024-01-24 09:24:38 +0000
I, [2024-01-24T09:24:38.426926 #240559] INFO -- : [6733bddb-7979-4643-9523-58dc9d1483b1] Processing by IssuesController#show as HTML
I, [2024-01-24T09:24:38.426974 #240559] INFO -- : [6733bddb-7979-4643-9523-58dc9d1483b1] Parameters: {"id"=>"12114"}
I, [2024-01-24T09:24:38.430428 #240559] INFO -- : [6733bddb-7979-4643-9523-58dc9d1483b1] Current user: XX.XXX (id=149)
I, [2024-01-24T09:24:38.464367 #240559] INFO -- : [6733bddb-7979-4643-9523-58dc9d1483b1] Completed 500 Internal Server Error in 37ms (ActiveRecord: 11.4ms | Allocations: 12798)
F, [2024-01-24T09:24:38.465162 #240559] FATAL -- : [6733bddb-7979-4643-9523-58dc9d1483b1]
[6733bddb-7979-4643-9523-58dc9d1483b1] ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'roles.default_time_entry_activity_id' in 'where clause'):
[6733bddb-7979-4643-9523-58dc9d1483b1]
[6733bddb-7979-4643-9523-58dc9d1483b1] app/models/time_entry_activity.rb:68:in `sort'
[6733bddb-7979-4643-9523-58dc9d1483b1] app/models/time_entry_activity.rb:68:in `default_activity_id'
[6733bddb-7979-4643-9523-58dc9d1483b1] app/models/time_entry.rb:110:in `initialize'
[6733bddb-7979-4643-9523-58dc9d1483b1] app/controllers/issues_controller.rb:114:in `block (2 levels) in show'
[6733bddb-7979-4643-9523-58dc9d1483b1] app/controllers/issues_controller.rb:110:in `show'
[6733bddb-7979-4643-9523-58dc9d1483b1] lib/redmine/sudo_mode.rb:61:in `sudo_mode'
I, [2024-01-24T09:24:56.497736 #240559] INFO -- : [443675d9-4966-4d61-9021-93f31d8acd15] Started GET "/" for xx.xx.xx.xxx at 2024-01-24 09:24:56 +0000
I, [2024-01-24T09:24:56.498369 #240559] INFO -- : [443675d9-4966-4d61-9021-93f31d8acd15] Processing by WelcomeController#index as HTML

The error comes from this code:

Can you help us if possible?

Thanks & Regards,
Ye


Files

Actions #1

Updated by Marius BÄ‚LTEANU 8 months ago

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

That column is added by the migration 20220806215628_add_default_time_entry_activity_to_roles.rb (source:trunk/db/migrate/20220806215628_add_default_time_entry_activity_to_roles.rb).

You need to check if the migration file exists on your disk and if it ran successfully. Otherwise, please contact Bitnami support because there is nothing to do from Redmine point of view. As last resort, you can manually add that column to the database, but you need to have experience with such kind of operations and you need to backup your database before.

Actions

Also available in: Atom PDF