Project

General

Profile

Upgrade 5.0.4 to 5.1.4 fail at db:migrate

Added by Pavel Pavlov about 1 month ago

Здравствуйте!
При обновлении redmine с версии 5.0.4 на 5.1.4 проходит миграция базы данных


Replies (3)

RE: Upgrade 5.0.4 to 5.1.4 fail at db:migrate - Added by Pavel Pavlov about 1 month ago

bundle exec rake db:migrate RAILS_ENV=production --trace > /opt/log.txt
(in /opt/redmine_new)
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Duplicate column name 'updated_on'
/var/lib/gems/3.0.0/gems/mysql2-0.5.6/lib/mysql2/client.rb:151:in `_query'
/var/lib/gems/3.0.0/gems/mysql2-0.5.6/lib/mysql2/client.rb:151:in `block in query'
/var/lib/gems/3.0.0/gems/mysql2-0.5.6/lib/mysql2/client.rb:150:in `handle_interrupt'
/var/lib/gems/3.0.0/gems/mysql2-0.5.6/lib/mysql2/client.rb:150:in `query'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:206:in `block (2 levels) in execute'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:205:in `block in execute'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract_adapter.rb:696:in `block (2 levels) in log'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract_adapter.rb:695:in `block in log'
/var/lib/gems/3.0.0/gems/activesupport-6.1.7.10/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract_adapter.rb:687:in `log'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:204:in `execute'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/mysql/database_statements.rb:52:in `execute'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract/schema_statements.rb:611:in `add_column'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:929:in `block in method_missing'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:897:in `block in say_with_time'
/usr/lib/ruby/3.0.0/benchmark.rb:293:in `measure'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:897:in `say_with_time'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:918:in `method_missing'
/opt/redmine_new/db/migrate/20220714093000_add_journal_updated_on.rb:3:in `up'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:870:in `public_send'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:870:in `exec_migration'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:851:in `block (2 levels) in migrate'
/usr/lib/ruby/3.0.0/benchmark.rb:293:in `measure'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:850:in `block in migrate'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:849:in `migrate'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1037:in `migrate'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1329:in `block in execute_migration_in_transaction'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1382:in `ddl_transaction'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1328:in `execute_migration_in_transaction'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1302:in `each'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1302:in `migrate_without_lock'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1251:in `block in migrate'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1401:in `block in with_advisory_lock'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1416:in `block in with_advisory_lock_connection'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:462:in `with_connection'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1416:in `with_advisory_lock_connection'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1397:in `with_advisory_lock'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1251:in `migrate'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1086:in `up'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/migration.rb:1061:in `migrate'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <top (required)>'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/railties/databases.rake:90:in `each'
/var/lib/gems/3.0.0/gems/activerecord-6.1.7.10/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <top (required)>'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:83:in `block in run'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/var/lib/gems/3.0.0/gems/rake-13.2.1/lib/rake/application.rb:80:in `run'
/var/lib/gems/3.0.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:25:in `load'
/usr/local/bin/rake:25:in `<main>'

Остаются незавершеннымим следующие пункты

RE: Upgrade 5.0.4 to 5.1.4 fail at db:migrate - Added by Pavel Pavlov about 1 month ago

  down    20220714093000  Add journal updated on
  down    20220714093010  Add journal updated by
  down    20220806215628  Add default time entry activity to roles
  down    20221002193055  Delete orphaned query and role from queries roles
  down    20221004172825  Ensure text formatting setting is stored in db
  down    20221012135202  Add index to custom values
  down    20221214173537  Add select project publicity permission
  down    20230818020734  Add status description
  down    20231012112407  Remove mention users permission

RE: Upgrade 5.0.4 to 5.1.4 fail at db:migrate - Added by Pavel Pavlov about 1 month ago

Environment:
Redmine version 5.1.4.stable
Ruby version 3.0.2-p107 (2021-07-07) [x86_64-linux-gnu]
Rails version 6.1.7.10
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
Redmine settings:
Redmine theme Circle (includes JavaScript)
SCM:
Git 2.34.1
Filesystem
Redmine plugins:
redmine_agile 1.6.5
redmine_issue_dynamic_edit 0.9.1
redmine_questions 1.0.4
redmine_zenedit 2.0.4

    (1-3/3)