Upgrade foreman 3.3 to 3.4 Error in foreman-rake db:migrate step

Hi all,

im trying to upgrade foreman from 3.3 to 3.4 in the step we get an error:

foreman-rake db:migrate

the output:

Caused by:
PG::DuplicateColumn: ERROR:  column "serialized_args" of relation "dynflow_delayed_plans" already exists
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:171:in `exec'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:171:in `block in execute_query'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/logging.rb:38:in `log_connection_yield'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:171:in `execute_query'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:159:in `block in execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:136:in `check_disconnect_errors'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:159:in `execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:528:in `_execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:344:in `block (2 levels) in execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:551:in `check_database_errors'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:344:in `block in execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/connection_pool/threaded.rb:88:in `hold'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/connecting.rb:269:in `synchronize'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/adapters/postgres.rb:344:in `execute'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/query.rb:50:in `execute_dui'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/query.rb:43:in `execute_ddl'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/schema_methods.rb:436:in `block in apply_alter_table'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/schema_methods.rb:436:in `each'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/schema_methods.rb:436:in `apply_alter_table'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/schema_methods.rb:449:in `apply_alter_table_generator'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/schema_methods.rb:70:in `alter_table'
/usr/share/foreman/vendor/ruby/2.7.0/gems/dynflow-1.6.7/lib/dynflow/persistence_adapters/sequel_migrations/012_add_delayed_plans_serialized_args.rb:4:in `block (2 levels) in <top (required)>'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:110:in `instance_exec'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:110:in `apply'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:566:in `block (2 levels) in run'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/transactions.rb:258:in `_transaction'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/transactions.rb:233:in `block in transaction'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/connection_pool/threaded.rb:92:in `hold'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/connecting.rb:269:in `synchronize'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/database/transactions.rb:195:in `transaction'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:482:in `checked_transaction'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:565:in `block in run'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:562:in `each'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:562:in `run'
/usr/share/foreman/vendor/ruby/2.7.0/gems/sequel-5.61.0/lib/sequel/extensions/migration.rb:409:in `run'
/usr/share/foreman/vendor/ruby/2.7.0/gems/dynflow-1.6.7/lib/dynflow/persistence_adapters/sequel.rb:271:in `migrate_db'
/usr/share/foreman/lib/tasks/dynflow.rake:23:in `block (2 levels) in <top (required)>'
/usr/share/foreman/lib/tasks/dynflow.rake:42:in `block (2 levels) in <top (required)>'
/usr/share/foreman/vendor/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
Tasks: TOP => dynflow:migrate
(See full trace by running task with --trace)

How can I solve this?

maybe one of you can help me: @ekohl @wbclark @gvde

Hi,

I’ve got a similar problem when migrating from v3.2 to v3.3 (Problem Upgrading Foreman from Version 3.2 to 3.3). @aruzicka was able to help.

I’m wondering, did you encounter this problem when upgrading to v3.4? I’m still not able to upgrade.

1 Like

Thanks @eagu for you answer, I’ll try that.

About your problem, do you try:

sudo apt-get update && sudo apt-get -y install ruby-foreman-tasks

Hi @Neeloj,

Did you solve your problem?

sudo apt-get update && sudo apt-get -y install ruby-foreman-tasks that is exactly what I’m trying but the problem is still there. I saw someone else having the same problem when doing a fresh install of v3.4.

I upgrade from 3.3.1 to 3.4 and I restore my old database and I redo the installation and it works for me!

For me until now and all issues/problmes which I see when you want to upgrade foreman, the upgrade proccess is not stable!

And community here is good but not enough! and if you upgrade on test system it work! but on prod it doesnt work same steps same distro version! its very strange !

you issue is since days and no one answer it! I have also open posts! for me the upgrade proccess is not stable!

thanks @eagu

@eagu can you try this:

sudo apt-get update && sudo apt-get --reinstall install ruby-foreman-tasks

In the end it was a packaging problem in Foreman, everything works now. Thanks for your suggestions @Neeloj.

Ref: Not able to upgrade Foreman from v3.3 to v3.4 - #9 by evgeni

1 Like