Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate
Added by Hofei - over 5 years ago
Hello,
have problems updating from version 3.3.4 to version 4.0.2.
A clean installation works. After deleting the new database and importing the backup of the database from version 3.3.4 I get the following error message after executing the command:
bundle exec rake db:migrate RAILS_ENV=production
Migrating to AddTrackerIdIndexToWorkflows (20161001122012) == 20161001122012 AddTrackerIdIndexToWorkflows: migrating ===================== -- add_index(:workflows, :tracker_id) -> 0.1208s == 20161001122012 AddTrackerIdIndexToWorkflows: migrated (0.1211s) ============ Migrating to AddIndexOnMemberRolesInheritedFrom (20161002133421) == 20161002133421 AddIndexOnMemberRolesInheritedFrom: migrating =============== -- add_index(:member_roles, :inherited_from) -> 0.4662s == 20161002133421 AddIndexOnMemberRolesInheritedFrom: migrated (0.4666s) ====== Migrating to ChangeIssuesDescriptionLimit (20161010081301) == 20161010081301 ChangeIssuesDescriptionLimit: migrating ===================== -- adapter_name() -> 0.0001s -- change_column(:issues, :description, :text, {:limit=>16777216}) -> 13.2286s == 20161010081301 ChangeIssuesDescriptionLimit: migrated (13.2296s) =========== Migrating to ChangeJournalDetailsValueLimit (20161010081528) == 20161010081528 ChangeJournalDetailsValueLimit: migrating =================== -- adapter_name() -> 0.0000s -- change_column(:journal_details, :value, :text, {:limit=>16777216}) -> 1.3586s -- adapter_name() -> 0.0000s -- change_column(:journal_details, :old_value, :text, {:limit=>16777216}) -> 1.8053s == 20161010081528 ChangeJournalDetailsValueLimit: migrated (3.1653s) ========== Migrating to ChangeJournalsNotesLimit (20161010081600) == 20161010081600 ChangeJournalsNotesLimit: migrating ========================= -- adapter_name() -> 0.0001s -- change_column(:journals, :notes, :text, {:limit=>16777216}) -> 0.6732s == 20161010081600 ChangeJournalsNotesLimit: migrated (0.6742s) ================ Migrating to AddIndexOnChangesetsIssuesIssueId (20161126094932) == 20161126094932 AddIndexOnChangesetsIssuesIssueId: migrating ================ -- add_index(:changesets_issues, :issue_id) -> 0.0339s == 20161126094932 AddIndexOnChangesetsIssuesIssueId: migrated (0.0342s) ======= Migrating to AddIndexOnIssuesParentId (20161220091118) == 20161220091118 AddIndexOnIssuesParentId: migrating ========================= -- add_index(:issues, :parent_id) rake aborted! StandardError: An error has occurred, all later migrations canceled: Index name 'index_issues_on_parent_id' on table 'issues' already exists /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:1160:in `add_index_options' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:380:in `add_index' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:871:in `block in method_missing' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `block in say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:860:in `method_missing' /opt/redmine/redmine-4.0.2/db/migrate/20161220091118_add_index_on_issues_parent_id.rb:3:in `change' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:814:in `exec_migration' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:797:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:796:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:977:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1345:in `ddl_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `each' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1363:in `with_advisory_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' /var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>' Caused by: ArgumentError: Index name 'index_issues_on_parent_id' on table 'issues' already exists /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:1160:in `add_index_options' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:380:in `add_index' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:871:in `block in method_missing' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `block in say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:860:in `method_missing' /opt/redmine/redmine-4.0.2/db/migrate/20161220091118_add_index_on_issues_parent_id.rb:3:in `change' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:814:in `exec_migration' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:797:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:796:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:977:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1345:in `ddl_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `each' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1363:in `with_advisory_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' /var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>' Tasks: TOP => db:migrate (See full trace by running task with --trace)
How can I fix this error? Is there a bug in the Redmine version?
If I "ignore" the error and restart Apache2 I get the same error as in this thread here: https://www.redmine.org/boards/1/topics/56719
All projects and tickets are available, but when I go to configuration of the respective project I get the following error message:
Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.
If you are the Redmine administrator, check your log files for details about the error.
Hallo,
habe Probleme bei einem Update von Version 3.3.4.stable auf Version 4.0.2.
Eine Cleaninstallation funktioniert. Sobald ich habe die neue Datenbank lösche, und das Backup der Datenbank von Version 3.3.4 einspiele erhalte ich nach Ausführung des Befehls:
bundle exec rake db:migrate RAILS_ENV=production
folgende Fehlermeldung:
Migrating to AddTrackerIdIndexToWorkflows (20161001122012) == 20161001122012 AddTrackerIdIndexToWorkflows: migrating ===================== -- add_index(:workflows, :tracker_id) -> 0.1208s == 20161001122012 AddTrackerIdIndexToWorkflows: migrated (0.1211s) ============ Migrating to AddIndexOnMemberRolesInheritedFrom (20161002133421) == 20161002133421 AddIndexOnMemberRolesInheritedFrom: migrating =============== -- add_index(:member_roles, :inherited_from) -> 0.4662s == 20161002133421 AddIndexOnMemberRolesInheritedFrom: migrated (0.4666s) ====== Migrating to ChangeIssuesDescriptionLimit (20161010081301) == 20161010081301 ChangeIssuesDescriptionLimit: migrating ===================== -- adapter_name() -> 0.0001s -- change_column(:issues, :description, :text, {:limit=>16777216}) -> 13.2286s == 20161010081301 ChangeIssuesDescriptionLimit: migrated (13.2296s) =========== Migrating to ChangeJournalDetailsValueLimit (20161010081528) == 20161010081528 ChangeJournalDetailsValueLimit: migrating =================== -- adapter_name() -> 0.0000s -- change_column(:journal_details, :value, :text, {:limit=>16777216}) -> 1.3586s -- adapter_name() -> 0.0000s -- change_column(:journal_details, :old_value, :text, {:limit=>16777216}) -> 1.8053s == 20161010081528 ChangeJournalDetailsValueLimit: migrated (3.1653s) ========== Migrating to ChangeJournalsNotesLimit (20161010081600) == 20161010081600 ChangeJournalsNotesLimit: migrating ========================= -- adapter_name() -> 0.0001s -- change_column(:journals, :notes, :text, {:limit=>16777216}) -> 0.6732s == 20161010081600 ChangeJournalsNotesLimit: migrated (0.6742s) ================ Migrating to AddIndexOnChangesetsIssuesIssueId (20161126094932) == 20161126094932 AddIndexOnChangesetsIssuesIssueId: migrating ================ -- add_index(:changesets_issues, :issue_id) -> 0.0339s == 20161126094932 AddIndexOnChangesetsIssuesIssueId: migrated (0.0342s) ======= Migrating to AddIndexOnIssuesParentId (20161220091118) == 20161220091118 AddIndexOnIssuesParentId: migrating ========================= -- add_index(:issues, :parent_id) rake aborted! StandardError: An error has occurred, all later migrations canceled: Index name 'index_issues_on_parent_id' on table 'issues' already exists /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:1160:in `add_index_options' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:380:in `add_index' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:871:in `block in method_missing' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `block in say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:860:in `method_missing' /opt/redmine/redmine-4.0.2/db/migrate/20161220091118_add_index_on_issues_parent_id.rb:3:in `change' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:814:in `exec_migration' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:797:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:796:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:977:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1345:in `ddl_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `each' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1363:in `with_advisory_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' /var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>' Caused by: ArgumentError: Index name 'index_issues_on_parent_id' on table 'issues' already exists /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:1160:in `add_index_options' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:380:in `add_index' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:871:in `block in method_missing' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `block in say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:840:in `say_with_time' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:860:in `method_missing' /opt/redmine/redmine-4.0.2/db/migrate/20161220091118_add_index_on_issues_parent_id.rb:3:in `change' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:814:in `exec_migration' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:797:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:796:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:977:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1345:in `ddl_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1263:in `block in migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `each' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1262:in `migrate_without_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `block in migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1363:in `with_advisory_lock' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate' /var/lib/gems/2.3.0/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>' /var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>' Tasks: TOP => db:migrate (See full trace by running task with --trace)
Wie kann ich diesen Fehler beheben? Liegt hier ein Bug in der Version von Redmine vor?
Wenn ich den Fehler "ignoriere" und Apache2 neustarte erhalte ich das selbe Fehlerbild wie in diesem Thread hier: https://www.redmine.org/boards/1/topics/56719
Es sind alle Projekte und Tickets vorhanden, wenn ich aber auf Konfigruation des jeweiligen Projektes gehe kommt folgende Fehlermeldung:
Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.
If you are the Redmine administrator, check your log files for details about the error.
Information on my System:
Environment: Redmine version 4.0.2.stable Ruby version 2.3.3-p222 (2016-11-21) [arm-linux-gnueabihf] Rails version 5.2.2 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp SCM: Filesystem Redmine plugins: no plugin installed Package: mariadb-server Source: mariadb-10.1 Version: 10.1.37-0+deb9u1 Raspbian GNU/Linux 9 (stretch) 4.14.79-v7+
Replies (7)
RE: Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate - Added by Julien Cosso over 5 years ago
run
alter table issues drop index index_issues_on_parent_id;
on database
RE: Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate - Added by Hofei - over 5 years ago
Thank you, its work!
i can reproduce this failure on every time when i try update with the old database.
Is this a Bug from Redmine?
RE: Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate - Added by Go MAEDA over 5 years ago
Hofei - wrote:
i can reproduce this failure on every time when i try update with the old database.
Have you added the index index_issues_on_parent_id manually in the past? I cannot figure out the reason why the migration in your environment fails but Redmine 3.3 or earlier does not have an index with the name.
RE: Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate - Added by Hofei - over 5 years ago
No, I didn't manually change anything on the database.
The only thing I could imagine is that a plugin added it?!
This plugins are installed on Version 3.3.4
Environment: Redmine version 3.3.4.stable Ruby version 2.3.3-p222 (2016-11-21) [arm-linux-gnueabihf] Rails version 4.2.7.1 Environment production Database adapter Mysql2 SCM: Git 2.11.0 Redmine plugins: recurring_tasks 2.0.0-pre redmine_checklists 3.1.11 redmine_dmsf 1.5.9 redmine_issue_templates 0.1.9 redmine_people 1.3.2 redmine_work_time 0.3.4
RE: Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate - Added by fouad bokholef over 5 years ago
thanks, its work!
i'm able to reproduce this failure on on every occasion when I strive update with the antique database.
is that this a bug from Redmine?
RE: Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate - Added by Go MAEDA over 5 years ago
fouad bokholef wrote:
i'm able to reproduce this failure on on every occasion when I strive update with the antique database.
is that this a bug from Redmine?
I think some plugin added the index index_issues_on_parent_id. Redmine has never added such an index before Redmine 3.4.
RE: Failure Upgrade from 3.3.4 to 4.0.2 on db:migrate - Added by vivek kachhwaha over 5 years ago
I think some plugin added the index index_issues_on_parent_id. Redmine has never added such an index before Redmine 3.4.