Project

General

Profile

Actions

Defect #37276

closed

When creating a new version - get "Status is not included in the list"

Added by Richard Hafenscher over 2 years ago. Updated almost 2 years ago.

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

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

When I try to create a new version in the projects roadmap I get this error:
"Status is not included in the list"
and the version is not created. Sreenshot attached.

My installation:

  Redmine version                4.2.6.stable
  Ruby version                   2.5.9-p229 (2021-04-05) [x86_64-linux-gnu]
  Rails version                  5.2.8
  Environment                    production
  Database adapter               Mysql2
  Database                       MariaDB 10.5.16

I removed all plugins for testing and did a fresh installation using the existing database, but the error persists.

However, if I create a new database the error is gone and the version gets created successfully.

There is no error in the production.log to see:

Started POST "/projects/kundenmeldungen/versions" for 188.23.203.175 at 2022-06-23 14:04:34 +0200
Processing by VersionsController#create as HTML
  Parameters: {"utf8"=>"\u2713", "authenticity_token"=>"<HIDDEN>==", "back_url"=>"/projects/kundenmeldungen/versions/new?back_url=", "version"=>{"name"=>"Test 0.1", "description"=>"Testversion 01", "wiki_page_title"=>"", "effective_date"=>"2023-06-23", "sharing"=>"none", "default_project_version"=>"0"}, "commit"=>"Create", "project_id"=>"kundenmeldungen"}
  Current user: <HIDDEN> (id=15)
  Rendering versions/new.html.erb within layouts/base
  Rendered versions/_form.html.erb (5.6ms)
  Rendered versions/new.html.erb within layouts/base (6.4ms)
Completed 200 OK in 50ms (Views: 24.1ms | ActiveRecord: 12.3ms)

Anyone any idea, how to resolve this. Seems it's something wrong in the database, but I've no idea where to look.


Files

Actions #1

Updated by Holger Just over 2 years ago

  • Status changed from New to Needs feedback

The default version status of open is not set explicitly by Redmine but is inferred from the database schema which sets the default value of the status column in the versions table open. I may be that you have applied an additional migration (e.g. by a plugin you may have had installed previously) which changed the default value of the column. You can verify this by checking your database schema.

Note that plugins may add arbitrary changes to your database you providing custom migrations or performing updates during normal operation. This is not somehting Redmine can restrict. However, when removing plugins, you should also remove the changes the plugin has done to your database.

At minimum, this usually requires to reverse all migrations with

rake redmine:plugins:migrate NAME=<plugin_name> VERSION=0

Note that this will generally delete data from your database. Make sure to have a working backup before to be able to restore this if required.

Also note that some plugins do not provide proper reverse-migrations and thus can't be removed easily. In that case, it may be required to manually reverse any changes the plugin may have added.

Actions #2

Updated by Richard Hafenscher over 2 years ago

Yes, you're absolutely right. The default status value was set to NULL.
Thank you very much! It works now.

And yes, I had some installed plugins, which I have removed again yet, since they're no longer needed. However, I uninstalled each with "migrate VERSION=0". But I guess, not all plugins did the reverse-migration properly as you mentioned.

I was thinking about a wrong default value in the database before, but since there was no log entry for trying to insert the stated values in the database at all, what I was expecting, I dropped this idea. But obviously the default values are read at the application start and kept in memory. And the app rejects an entry if it doesn't match later.

In that case, it may be required to manually reverse any changes the plugin may have added.

I assume, the only way to achieve this is to notice the migration steps when installing a plugin and save it for later manual removing them in the database?

Actions #3

Updated by Go MAEDA almost 2 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid

Closing this issue because the problem is apparently caused by a third-party plugin.

Actions

Also available in: Atom PDF