Defect #27319

Impossible to create a new version

Added by Yohann Prigent 24 days ago. Updated 4 days ago.

Status:Needs feedbackStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Projects
Target version:-
Resolution: Affected version:3.4.3

Description

Hello,

I recently upgraded to Redmine 3.4.3, and I can't create new versions in projects. I have this error :

Status is not included in the list

Nothing in the log...

Screenshot 2017-10-31 13.46.34.png (93.5 KB) Yohann Prigent, 2017-10-31 13:47

Screenshot 2017-10-31 13.47.05.png (112 KB) Yohann Prigent, 2017-10-31 13:49

status_error.png (9.54 KB) Adam Gay, 2017-11-15 17:56

History

#1 Updated by Go MAEDA 24 days ago

  • Status changed from New to Needs feedback

Are you experiencing the problem in all projects? Or in a particular project?

#2 Updated by Yohann Prigent 24 days ago

In all project. The field status for the new version form is not appearing anymore, triggering the error on submit.

#3 Updated by Go MAEDA 24 days ago

I don't understand the cause, but it may be caused by some plugin. Could you try without any plugin?

#4 Updated by Yohann Prigent 24 days ago

I've removed all plugins, and changed the theme to the default one to be sure. Same issue.

#5 Updated by Toshi MARUYAMA 23 days ago

  • Description updated (diff)

#6 Updated by Toshi MARUYAMA 23 days ago

Yohann Prigent wrote:

In all project. The field status for the new version form is not appearing anymore, triggering the error on submit.

What is "The field status for the new version"?

#7 Updated by Yohann Prigent 23 days ago

Here you can see two screenshots.

The first one with the default theme on the page to create a new version, where the field Status is not added (and generating the version).

The second one on another Redmine instance not upgraded which have the field Status, no not generating the error when I try to save this new version.

#8 Updated by Toshi MARUYAMA 23 days ago

Yohann Prigent wrote:

The first one with the default theme on the page to create a new version, where the field Status is not added (and generating the version).

It is expected behaviour.
source:tags/3.4.3/app/views/versions/_form.html.erb#L7

Check your db definition.

source:tags/3.4.3/db/migrate/20091108092559_add_versions_status.rb#L3

add_column :versions, :status, :string, :default => 'open'

#9 Updated by Yohann Prigent 23 days ago

I do not have the default open added to my column in my db (MariaDB). I tried to run again bundle exec rake db:migrate RAILS_ENV=production but same issue. I've added the field manually to the db and now it works... Migration issue ?

#10 Updated by Toshi MARUYAMA 23 days ago

MariaDB is not supported.

#11 Updated by Adam Gay 8 days ago

@Toshi, how exactly do I check the db definition?

I am having this exact issue, however I am using the mysql2 db adapter.

Background on my instance of RM, we started out with Redmine v1.2 long time ago, and I've been steadily upgrading with most new versions. We haven't had a problem until we recently moved from v3.3 to v3.4.

EDIT: I've run the rake commands several times like so, but the issue remains:

bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production

EDIT2: I just tried to run this command thinking it might add the column that's possibly missing (based on comment #9), but the issue persists:

bundle exec add_column :versions, :status, :string, :default => 'open'

EDIT3: Tried another rake command, but still no luck:

# bundle exec rake redmine:load_default_data

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, es-PA, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]
====================================
Some configuration data is already loaded.

Details on my environment:

Environment:
  Redmine version                3.4.3.stable
  Ruby version                   2.4.2-p198 (2017-09-14) [x86_64-linux]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.8.10
  Mercurial                      3.1.2
  Bazaar                         2.7.0
  Git                            2.1.4
  Filesystem                     
Redmine plugins:
  clipboard_image_paste          1.12
  redmine_base_deface            0.0.1
  redmine_maintenance_mode       2.1.0
  redmine_theme_changer          0.3.1

#12 Updated by Toshi MARUYAMA 8 days ago

Adam Gay wrote:

@Toshi, how exactly do I check the db definition?

mysql> desc versions;
+-----------------+--------------+------+-----+---------+----------------+
| Field           | Type         | Null | Key | Default | Extra          |
+-----------------+--------------+------+-----+---------+----------------+
| id              | int(11)      | NO   | PRI | NULL    | auto_increment |
| project_id      | int(11)      | NO   | MUL | 0       |                |
| name            | varchar(255) | NO   |     |         |                |
| description     | varchar(255) | YES  |     |         |                |
| effective_date  | date         | YES  |     | NULL    |                |
| created_on      | datetime     | YES  |     | NULL    |                |
| updated_on      | datetime     | YES  |     | NULL    |                |
| wiki_page_title | varchar(255) | YES  |     | NULL    |                |
| status          | varchar(255) | YES  |     | open    |                |
| sharing         | varchar(255) | NO   | MUL | none    |                |
+-----------------+--------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

#13 Updated by Adam Gay 8 days ago

Thanks Toshi. I have made my status field match yours. After I set the `status` column to default 'open', and then ran the same rake commands, I still have the issue.

mysql>  show columns from versions;
+-----------------+--------------+------+-----+---------+----------------+
| Field           | Type         | Null | Key | Default | Extra          |
+-----------------+--------------+------+-----+---------+----------------+
| id              | int(11)      | NO   | PRI | NULL    | auto_increment |
| project_id      | int(11)      | NO   | MUL | 0       |                |
| name            | varchar(255) | NO   |     |         |                |
| description     | varchar(255) | YES  |     |         |                |
| effective_date  | date         | YES  |     | NULL    |                |
| created_on      | datetime     | YES  |     | NULL    |                |
| updated_on      | datetime     | YES  |     | NULL    |                |
| wiki_page_title | varchar(255) | YES  |     | NULL    |                |
| status          | varchar(255) | YES  |     | open    |                |
| sharing         | varchar(255) | NO   | MUL | none    |                |
| ir_start_date   | date         | YES  |     | NULL    |                |
| ir_end_date     | date         | YES  |     | NULL    |                |
+-----------------+--------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)

EDIT: Made my versions table match yours exactly, except for the two additional columns I have. The issue still persists.

#14 Updated by Adam Gay 8 days ago

Here's a screenshot of the page after I made the db changes. The "status" drop down does not appear. However if I go and try to edit an already existing version, the "status" dropdown is available and I can submit the changes without issue.

#15 Updated by Adam Gay 8 days ago

I can manually add the new version via MySQL console, and then go into the Redmine interface and edit it. This at least allows my software team to continue working, however it is not ideal if I have to add new versions via console every time.

EDIT: for reference to anyone out there that may be experiencing this same issue with MySQL, here's what I ran in MySQL to add the info:

INSERT INTO versions (project_id,name,status,sharing)
VALUES (1,'name of version','open','descendants');

#16 Updated by Adam Gay 7 days ago

I updated a few components on my server's backend last night, and after a soft reboot of the server itself my issue has now magically disappeared.

It seems like the issue may have been resolved after the update to v3.4.3 by:
  1. Manually setting the MySQL db details as above (status to default 'open')
  2. Running rake commands
  3. Reboot the server

It's unclear what step was actually the resolution. Perhaps an Apache restart? I don't use Passenger in my instance, and it is virtualized behind a proxy, so it doesn't fully make sense to me that the Apache restart on the bare server would have done anything. I had rebooted the VM a couple of times yesterday with no luck, but a full server reboot seemed to do the trick. Odd, but at least we're back to normal now.

Also available in: Atom PDF