Defect #38389


Cannot open time entries

Added by Michele Franceschet about 1 year ago. Updated about 1 year ago.

Time tracking
Target version:
Start date:
Due date:
% Done:


Estimated time:
Affected version:


After migrating from redmine 3.3 to redmine 5.0.5.stable some of the projects won't show their time entries despite others.
I personally migrated the rows from the old SQL server to the new one, paying attention to the structures of the new tables. Everything else works correctly, only for a few projects I get this error:

I, [2023-03-29T09:46:02.443457 #59969] INFO -- : [362f69ea-17ee-4dfc-9977-e1a8acf7401c] Rendered timelog/index.html.erb within layouts/base (Duration: 216.2ms | Allocations: 111358)
I, [2023-03-29T09:46:02.443536 #59969] INFO -- : [362f69ea-17ee-4dfc-9977-e1a8acf7401c] Rendered layout layouts/base.html.erb (Duration: 216.3ms | Allocations: 111386)
I, [2023-03-29T09:46:02.443686 #59969] INFO -- : [362f69ea-17ee-4dfc-9977-e1a8acf7401c] Completed 500 Internal Server Error in 316ms (ActiveRecord: 45.3ms | Allocations: 135976)
F, [2023-03-29T09:46:02.444390 #59969] FATAL -- : [362f69ea-17ee-4dfc-9977-e1a8acf7401c]
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] ActionView::Template::Error (undefined method `is_closed' for nil:NilClass):
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] 36: <% @query.inline_columns.each do |column| >
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] 37: <
= content_tag('td', column_content(column, entry), :class => column.css_classes) >
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] 38: <
end >
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] 39: <td class="buttons">
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] 40: <
if entry.editable_by?(User.current) ->
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] 41: <
= link_to l(:button_edit), edit_time_entry_path(entry),
[362f69ea-17ee-4dfc-9977-e1a8acf7401c] 42: :title => l(:button_edit),

Does anyone have any clue to solve this?
Feel free to ask any additional information
Best Regards

Actions #1

Updated by Holger Just about 1 year ago

  • Status changed from New to Needs feedback

It seems that you have a time entry referencing an issue which in turn is referencing an issue status which does not exist anymore. Specifically, there appears to be an issue with a status_id field referencing a missing ID in the issue_statuses table.

Usually this should not happen as an issue status can only be deleted if there are no issues referencing this status anymore. If you manually delete an issue status from the database however, this may result in this data inconsistency. You can verifiy this with the following raw SQL query:

SELECT * from issues where status_id NOT IN (SELECT id FROM issue_statuses);

If this query returns any results, you have to manually update those issues to refer to an existing status_id.

For the future, you may want to avoid manually editing your database and values. Redmine heavily relies on data consistency rules defined within Rails. As such, manually editing the database can easily result in data inconsistencies which may manifest only much later and in unexpected places as you have seen here.

Actions #2

Updated by Michele Franceschet about 1 year ago

Thank you Holger,
you were right. In some of the tables rows the data wasn't correct.

Solved by correcting it!

Actions #3

Updated by Holger Just about 1 year ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid
Actions #4

Updated by Holger Just about 1 year ago

Thanks for confirming!


Also available in: Atom PDF