Project

General

Profile

2.1.2 - Create New Issue Fails

Added by Tom Bodet about 12 years ago

I've got a dev server we've been trying out 2.x with. We take our current 1.0.1 database, run db:migrate on it and with 2.0 it's always gone fine. Now that we went from 2.0.4 to 2.1.2 there's a problem.

When I try to create a new issue, I get a 500 error. Looking at the dev log I see this:

Mysql2::Error: Column 'position' cannot be null:
INSERT INTO `issues` (`assigned_to_id`, `author_id`, `category_id`, `created_on`, `description`, `done_ratio`, `due_date`, `estimated_hours`, `fixed_version_id`, `is_private`, `lft`, `lock_version`, `parent_id`, `position`, `priority_id`, `project_id`, `remaining_hours`, `rgt`, `root_id`, `start_date`, `status_id`, `story_points`, `subject`, `tracker_id`, `updated_on`)
VALUES (NULL, 36, NULL, '2012-11-09 14:46:59', 'asfasfasfsadf', 0, NULL, NULL, NULL, 0, 1, 0, NULL, NULL, 4, 1, NULL, 2, NULL, '2012-11-09', 1, NULL, 'test', 1, '2012-11-09 14:46:59')

I see in the database.rb that in the issues table there is a not nullable field called position. That wasn't in the 1.x database we have and there are no plugins installed so I'm pretty sure this is a stock field.

Current about:
Environment:
Redmine version 2.1.2.stable
Ruby version 1.9.3 (x86_64-linux)
Rails version 3.2.8
Environment development
Database adapter Mysql2
Redmine plugins:
no plugin installed

What are we missing that position ends up being null on the INSERT?

ETA: Current environment bundle. This is on a Cent 6 64bit system. MYSQL is running on a second server, same OS.
Gems included by the bundle: * actionmailer (3.2.8) * actionpack (3.2.8) * activemodel (3.2.8) * activerecord (3.2.8) * activeresource (3.2.8) * activesupport (3.2.8) * arel (3.0.2) * builder (3.0.0) * bundler (1.1.3) * coderay (1.0.8) * erubis (2.7.0) * hike (1.2.1) * i18n (0.6.1) * journey (1.0.4) * jquery-rails (2.0.3) * json (1.7.5) * mail (2.4.4) * mime-types (1.19) * multi_json (1.3.7) * mysql2 (0.3.11) * net-ldap (0.3.1) * polyglot (0.3.3) * rack (1.4.1) * rack-cache (1.2) * rack-openid (1.3.1) * rack-ssl (1.3.2) * rack-test (0.6.2) * rails (3.2.8) * railties (3.2.8) * rake (0.9.2.2) * rdoc (3.12) * rmagick (2.13.1) * ruby-openid (2.1.8) * sprockets (2.1.3) * sqlite3 (1.3.6) * thor (0.16.0) * tilt (1.3.3) * treetop (1.4.12) * tzinfo (0.3.35) * yard (0.8.3)


Replies (8)

RE: 2.1.2 - Create New Issue Fails - Added by Pele Admin about 12 years ago

I have exactly the same issue running on Ubuntu 11, nginx and passenger. I upgraded from 1.4...anyone?

RE: 2.1.2 - Create New Issue Fails - Added by Tom Bodet about 12 years ago

We traced this to our migration script that copied the "plugin assets" directory since it's a health check item and the initial install doesn't have it. Even though we didn't have any plugins, there were leftovers in the assets directory which appear to have created the extra columns for a plugin on our 1.x system.

Redoing the migration (and leaving assets out of it) cleared it up. It's a plugin leftover, not Redmine itself.

RE: 2.1.2 - Create New Issue Fails - Added by Pele Admin about 12 years ago

Hey Tom,

Thanks for your quick reply...I don't have an option to go back, and i am trying to find the plugin that caused this. How did you come up with the trace?

Thanks

RE: 2.1.2 - Create New Issue Fails - Added by Tom Bodet about 12 years ago

Really it was a lot of fumbling around. We have a dev and prod instance so ultimately we just compared what we saw on prod to dev and re-did the db upgrade and watched it each step. Prior to plugin migration we checked the plugin_assets dir and noticed the files. Since we were not running those plugins we ditched the files and moved on with the upgrade. Works fine now.

RE: 2.1.2 - Create New Issue Fails - Added by Pele Admin about 12 years ago

Yeah, i found it as well. It was the backlogs plugin which even though i had it uninstalled, somehow the mysql table had still the column inside...What is I did was to install the plugin in the new environment and 'voila'...
Thanks for you quick responses

RE: 2.1.2 - Create New Issue Fails - Added by Pierre de LESPINAY about 11 years ago

Same issue here, also fixed it by re-installing Backlog.
If someone knows how to properly uninstall it, I'm interested.

RE: 2.1.2 - Create New Issue Fails - Added by Pierre de LESPINAY over 10 years ago

I had this problem again when re-upgrading redmine.
I finally ALLOWed NULL values for the field issues.position.

mysql> ALTER TABLE issues MODIFY position INT(11);

Hoping it won't generate any problem later.

RE: 2.1.2 - Create New Issue Fails - Added by Ivan Tsybanenko over 7 years ago

Pierre de LESPINAY wrote:

I had this problem again when re-upgrading redmine.
I finally ALLOWed NULL values for the field issues.position.

mysql> ALTER TABLE issues MODIFY position INT;

Hoping it won't generate any problem later.

Pierre Aitttahar de LESPINAY,
thanks for the solution!

It works for me too.

I think it's because of mistake in upgrade procedure.

    (1-8/8)