Project

General

Profile

Actions

Defect #31094

closed

Failure Upgrade from 3.3.4 to 4.0.2 on execute "bundle exec rake db:migrate RAILS_ENV=production"

Added by Hofei - over 5 years ago. Updated over 5 years ago.

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

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

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

Bevore bundle exec rake generate_secret_token its ok.

** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
== 20161001122012 AddTrackerIdIndexToWorkflows: migrating =====================
-- add_index(:workflows, :tracker_id)
   -> 0.1165s
== 20161001122012 AddTrackerIdIndexToWorkflows: migrated (0.1168s) ============

== 20161002133421 AddIndexOnMemberRolesInheritedFrom: migrating ===============
-- add_index(:member_roles, :inherited_from)
   -> 0.0928s
== 20161002133421 AddIndexOnMemberRolesInheritedFrom: migrated (0.0930s) ======

== 20161010081301 ChangeIssuesDescriptionLimit: migrating =====================
-- adapter_name()
   -> 0.0000s
-- change_column(:issues, :description, :text, {:limit=>16777216})
   -> 3.6314s
== 20161010081301 ChangeIssuesDescriptionLimit: migrated (3.6322s) ============

== 20161010081528 ChangeJournalDetailsValueLimit: migrating ===================
-- adapter_name()
   -> 0.0000s
-- change_column(:journal_details, :value, :text, {:limit=>16777216})
   -> 4.3541s
-- adapter_name()
   -> 0.0000s
-- change_column(:journal_details, :old_value, :text, {:limit=>16777216})
   -> 1.7060s
== 20161010081528 ChangeJournalDetailsValueLimit: migrated (6.0619s) ==========

== 20161010081600 ChangeJournalsNotesLimit: migrating =========================
-- adapter_name()
   -> 0.0001s
-- change_column(:journals, :notes, :text, {:limit=>16777216})
   -> 0.6429s
== 20161010081600 ChangeJournalsNotesLimit: migrated (0.6448s) ================

== 20161126094932 AddIndexOnChangesetsIssuesIssueId: migrating ================
-- add_index(:changesets_issues, :issue_id)
   -> 0.0339s
== 20161126094932 AddIndexOnChangesetsIssuesIssueId: migrated (0.0348s) =======

== 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'
/usr/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/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'
/usr/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/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/lib/rake/task.rb:273:in `block in execute'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:22:in `load'
/usr/local/bin/rake:22:in `<main>'

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'
/usr/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/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'
/usr/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
/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/lib/rake/task.rb:273:in `block in execute'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/var/lib/gems/2.3.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:22:in `load'
/usr/local/bin/rake:22:in `<main>'
Tasks: TOP => db:migrate

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.

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+

Actions

Also available in: Atom PDF