relation "agile_ranks_pkey" does not exist

1

ya.est.svet@yandex.ru ya.est.svet@yandex.ru
Added over 5 years ago

I am upgrading redmine-3.3 to redmine-4.0.3
database: postgresql

also, i have downloaded last plugin redmine_agile-light
miagrations gives the error:

  1. bundle exec rake redmine:plugins:migrate RAILS_ENV=production
(eval):53: warning: key :format is duplicated and overwritten on line 53
== 4 RenameAgileRanks: migrating ==============================================
-- index_exists?(:agile_ranks, :issue_id, {:name=>"index_agile_ranks_on_issue_id"})
   -> 0.0033s
-- index_exists?(:agile_ranks, :position, {:name=>"index_agile_ranks_on_position"})
   -> 0.0017s
-- rename_table(:agile_ranks, :agile_data)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedTable: ERROR:  relation "agile_ranks_pkey" does not exist
: ALTER INDEX "agile_ranks_pkey" RENAME TO "agile_data_pkey" 
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `async_exec'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels) in execute'
/var/lib/gems/2.3.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/var/lib/gems/2.3.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/var/lib/gems/2.3.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execute'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log'
/var/lib/gems/2.3.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:409:in `rename_table'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:871:in `block in method_missing'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `block in say_with_time'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `say_with_time'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:860:in `method_missing'
/home/redmine-4.0/plugins/redmine_agile/db/migrate/004_rename_agile_ranks.rb:25:in `up'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:817:in `exec_migration'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `block in transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:239:in `block in within_new_transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:236:in `within_new_transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:267:in `transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/transactions.rb:212:in `transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `ddl_transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `each'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `block in migrate'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1210:in `migrate'
/home/redmine-4.0/lib/redmine/plugin.rb:504:in `up'
/var/lib/gems/2.3.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1011:in `migrate'
/home/redmine-4.0/lib/redmine/plugin.rb:536:in `migrate_plugin'
/home/redmine-4.0/lib/redmine/plugin.rb:477:in `migrate'
/home/redmine-4.0/lib/redmine/plugin.rb:491:in `block in migrate'
/home/redmine-4.0/lib/redmine/plugin.rb:490:in `each'
/home/redmine-4.0/lib/redmine/plugin.rb:490:in `migrate'
/home/redmine-4.0/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'

Caused by:
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "agile_ranks_pkey" does not exist
: ALTER INDEX "agile_ranks_pkey" RENAME TO "agile_data_pkey" 

Please help to solve the problem

Dimitar Chervenakov over 5 years

Hello. To fix this issue, please do the next.

You need to create the index manually (run the next command in your database):

create unique index agile_ranks_pkey on agile_ranks (id);

Then please rerun migration command.

Answers (2)

1

barret wang
Added about 5 years ago

I also have the problem, can you help me?

[root@iZ94bxug1hxZ redmine.barret.wang]# bundle exec rake redmine:plugins:migrate RAILS_ENV=production
/opt/ruby2.4.6/lib/ruby/gems/2.4.0/gems/actionpack-4.2.11.1/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::VCF
/opt/ruby2.4.6/lib/ruby/gems/2.4.0/gems/actionpack-4.2.11.1/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of VCF was here
Migrating additionals (Additionals)...
Migrating clipboard_image_paste (Clipboard image paste)...
Migrating redmine_agile (Redmine Agile plugin (Light version))...
4 RenameAgileRanks: migrating ============================================
-- index_exists?(:agile_ranks, :issue_id)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Table 'redmine.agile_ranks' doesn't exist: SHOW KEYS FROM `agile_ranks`
/data/wwwroot/redmine.barret.wang/plugins/redmine_agile/db/migrate/004_rename_agile_ranks.rb:22:in `up'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:481:in `migrate_plugin'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:453:in `migrate'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:467:in `block in migrate'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:466:in `each'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:466:in `migrate'
/data/wwwroot/redmine.barret.wang/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/opt/ruby2.4.6/bin/bundle:23:in `load'
/opt/ruby2.4.6/bin/bundle:23:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'redmine.agile_ranks' doesn't exist: SHOW KEYS FROM `agile_ranks`
/data/wwwroot/redmine.barret.wang/plugins/redmine_agile/db/migrate/004_rename_agile_ranks.rb:22:in `up'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:481:in `migrate_plugin'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:453:in `migrate'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:467:in `block in migrate'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:466:in `each'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:466:in `migrate'
/data/wwwroot/redmine.barret.wang/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/opt/ruby2.4.6/bin/bundle:23:in `load'
/opt/ruby2.4.6/bin/bundle:23:in `<main>'

Caused by:
Mysql2::Error: Table 'redmine.agile_ranks' doesn't exist
/data/wwwroot/redmine.barret.wang/plugins/redmine_agile/db/migrate/004_rename_agile_ranks.rb:22:in `up'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:481:in `migrate_plugin'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:453:in `migrate'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:467:in `block in migrate'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:466:in `each'
/data/wwwroot/redmine.barret.wang/lib/redmine/plugin.rb:466:in `migrate'
/data/wwwroot/redmine.barret.wang/lib/tasks/redmine.rake:135:in `block (3 levels) in <top (required)>'
/opt/ruby2.4.6/bin/bundle:23:in `load'
/opt/ruby2.4.6/bin/bundle:23:in `<main>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)

Dimitar Chervenakov about 5 years

Hi. Please be so kind and provide your system info and complete logs to . The info could be found in Administration (on top) - Information. Logs could be found in redmine/log folder. Also, please specify what the problem is about.

-1

Dimitar Chervenakov
Added over 4 years ago

Hi. Please be so kind and provide your system info and complete logs to . The info could be found in Administration (on top) - Information. Logs could be found in redmine/log folder. Also, please specify what the problem is about.

    (1-2/2)