Project

General

Profile

Actions

Bug #22266

closed

Fresh installation of Foreman with Ansible plugin and proxy is broken after host restart

Added by Romans Krjukovs about 6 years ago. Updated almost 6 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hey,

Fresh installation of Foreman 1.16 with Ansible plugin and proxy on clean Ubuntu Xenial is broken after host restart.

Steps to reproduce:
- get clean OS (virtualbox in my case);
- enable Ansible ppa:

sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible

- install foreman installer:
sudo su - 
apt-get -y install ca-certificates
wget https://apt.puppetlabs.com/puppet5-release-xenial.deb
dpkg -i puppet5-release-xenial.deb

echo "deb http://deb.theforeman.org/ xenial 1.16" > /etc/apt/sources.list.d/foreman.list
echo "deb http://deb.theforeman.org/ plugins 1.16" >> /etc/apt/sources.list.d/foreman.list
apt-get -y install ca-certificates
wget -q https://deb.theforeman.org/pubkey.gpg -O- | apt-key add -

apt-get update && apt-get -y install foreman-installer

- install foreman:
foreman-installer --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible -v

- installation is complete without errors:
...
[DEBUG 2018-01-15T11:35:30 main]  Finishing transaction 65695780
[DEBUG 2018-01-15T11:35:30 main]  Received report to process from foremansible.lan
[ INFO 2018-01-15T11:35:33 main] Puppet has finished, bye!
[ INFO 2018-01-15T11:35:33 main] Executing hooks in group post
[DEBUG 2018-01-15T11:35:33 main] Hook /usr/share/foreman-installer/hooks/post/10-post_install_message.rb returned nil
[ INFO 2018-01-15T11:35:33 main] All hooks in group post finished
[DEBUG 2018-01-15T11:35:33 main] Exit with status code: 2 (signal was 2)
[DEBUG 2018-01-15T11:35:33 main] Cleaning /tmp/kafo_puppet20180115-9397-3rrchs.conf
[DEBUG 2018-01-15T11:35:33 main] Cleaning /tmp/kafo_hiera20180115-9397-b011lm
[DEBUG 2018-01-15T11:35:33 main] Cleaning /tmp/kafo_puppet20180115-9397-1aae9jd.conf
[DEBUG 2018-01-15T11:35:33 main] Cleaning /tmp/default_values.yaml
[ INFO 2018-01-15T11:35:33 main] Installer finished in 1356.3395379 seconds

- check Foreman is up & running via browser (is OK);
- restart host;
- check Foreman is up & running via browser (is NOK):
got "We're sorry, but something went wrong." etc.;

Latest error in /var/log/apache2/error.lg:

[ 2018-01-15 11:45:42.1745 1399/7ff5a005c700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /usr/share/foreman: An error occured while starting the web application.
  Error ID: 8fbdc3a8
  Error details saved to: /tmp/passenger-error-PSIaZW.html
  Message from application: PG::DuplicateColumn: ERROR:  column "version" of relation "dynflow_schema_info" already exists
 (Sequel::DatabaseError)
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `async_exec'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `block in execute_query'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/logging.rb:38:in `log_connection_yield'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `execute_query'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `block in execute'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:109:in `check_disconnect_errors'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `execute'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:449:in `_execute'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block (2 levels) in execute'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:471:in `check_database_errors'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block in execute'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `block in synchronize'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/connection_pool/threaded.rb:91:in `hold'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `synchronize'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `execute'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:50:in `execute_dui'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:43:in `execute_ddl'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `block in apply_alter_table'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `each'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `apply_alter_table'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:424:in `apply_alter_table_generator'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:70:in `alter_table'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:622:in `schema_dataset'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:450:in `initialize'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:517:in `initialize'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `new'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `run'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:238:in `migrate_db'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:46:in `initialize'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `new'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `initialize_persistence'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:107:in `block in world_config'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `tap'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `world_config'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:8:in `world_config'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:66:in `initialize_world'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:100:in `init_world'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:37:in `initialize!'
  /usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/engine.rb:153:in `block (2 levels) in <class:Engine>'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/public_api.rb:42:in `block in call_event'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/public_api.rb:41:in `each'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/public_api.rb:41:in `call_event'
  /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:393:in `before_handling_requests'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:134:in `negotiate_spawn_command'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:158:in `<module:App>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<main>'

[ 2018-01-15 11:45:42.1870 1399/7ff5a0bab700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-7] Cannot checkout session because a spawning error occurred. The identifier of the error is 8fbdc3a8. Please see earlier logs for details about the error.
App 2552 stdout: 
App 2552 stderr: The PGconn, PGresult, and PGError constants are deprecated, and will be
App 2552 stderr: removed as of version 1.0.
App 2552 stderr: 
App 2552 stderr: You should use PG::Connection, PG::Result, and PG::Error instead, respectively.
App 2552 stderr: 
App 2552 stderr: Called from /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `block in require'

Please, advise.
Thank You!

Regards
/Romans


Related issues 1 (0 open1 closed)

Is duplicate of Packaging - Bug #20050: ruby-sequel-pg DEB pollutes Foreman ruby gem environmentClosedIvan Necas06/19/2017Actions
Actions #3

Updated by Ewoud Kohl van Wijngaarden about 6 years ago

  • Related to Bug #20050: ruby-sequel-pg DEB pollutes Foreman ruby gem environment added
Actions #4

Updated by yannick N about 6 years ago

Hi,

Can u output : foreman-rake db:migrate

Actions #5

Updated by Romans Krjukovs about 6 years ago

Can u output : foreman-rake db:migrate

Here we go:

The PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.

You should use PG::Connection, PG::Result, and PG::Error instead, respectively.

Called from /usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `block in require'
rake aborted!
Sequel::DatabaseError: PG::DuplicateColumn: ERROR:  column "version" of relation "dynflow_schema_info" already exists
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `async_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `block in execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/logging.rb:38:in `log_connection_yield'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:109:in `check_disconnect_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:449:in `_execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block (2 levels) in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:471:in `check_database_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/connection_pool/threaded.rb:91:in `hold'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:50:in `execute_dui'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:43:in `execute_ddl'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `block in apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:424:in `apply_alter_table_generator'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:70:in `alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:622:in `schema_dataset'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:450:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:517:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:238:in `migrate_db'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:46:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `initialize_persistence'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:107:in `block in world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `tap'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:8:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:66:in `initialize_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:100:in `init_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:37:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/engine.rb:156:in `block in <class:Engine>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `instance_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:54:in `run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:352:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `public_send'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `block in require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:328:in `require_environment!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:457:in `block in run_tasks_blocks'

Caused by:
PG::DuplicateColumn: ERROR:  column "version" of relation "dynflow_schema_info" already exists
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `async_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `block in execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/logging.rb:38:in `log_connection_yield'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:109:in `check_disconnect_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:449:in `_execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block (2 levels) in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:471:in `check_database_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/connection_pool/threaded.rb:91:in `hold'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:50:in `execute_dui'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:43:in `execute_ddl'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `block in apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:424:in `apply_alter_table_generator'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:70:in `alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:622:in `schema_dataset'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:450:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:517:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:238:in `migrate_db'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:46:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `initialize_persistence'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:107:in `block in world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `tap'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:8:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:66:in `initialize_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:100:in `init_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:37:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/engine.rb:156:in `block in <class:Engine>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `instance_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:54:in `run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:352:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `public_send'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `block in require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:328:in `require_environment!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:457:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

Regards
/Romans

Actions #6

Updated by yannick N about 6 years ago

You should use PG::Connection, PG::Result, and PG::Error instead, respectively.

Do this :

  1. cd /usr/share/foreman
  2. nano bundler.d/postgresql.rb
     group :postgresql do
       # Matches gem requirement specified in ActiveRecord connection adapter
       #gem 'pg', (SETTINGS[:rails] == '4.2' ? '~> 0.15' : '~> 0.18')
       gem 'pg', '0.17.1'
     end
  3. gem install pg -v '0.17.1'
  4. bundle install
  5. foreman-rake db:migrate
Actions #7

Updated by Romans Krjukovs about 6 years ago

yannick N wrote:

Do this :

  1. cd /usr/share/foreman
  2. nano bundler.d/postgresql.rb
    [...]
  3. gem install pg -v '0.17.1'
  4. bundle install
  5. foreman-rake db:migrate

Here we go again:

root@foremansible:~# cd /usr/share/foreman
root@foremansible:/usr/share/foreman# vim postgresql.rb
root@foremansible:/usr/share/foreman# vim bundler.d/postgresql.rb
root@foremansible:/usr/share/foreman# gem install pg -v '0.17.1'
Fetching: pg-0.17.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed pg-0.17.1
invalid options: -f fivefish
(invalid options are ignored)
Parsing documentation for pg-0.17.1
Installing ri documentation for pg-0.17.1
Done installing documentation for pg after 1 seconds
1 gem installed
root@foremansible:/usr/share/foreman# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies......
Using rake 12.3.0
Using concurrent-ruby 1.0.3
Using minitest 5.10.3
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using crass 1.0.3
Using rack 1.6.8
Using mini_mime 1.0.0
Using arel 6.0.4
Using multi_json 1.12.2
Using thor 0.19.4
Using public_suffix 3.0.1
Using algebrick 0.7.5
Using apipie-params 0.0.5
Using bundler 1.11.2
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using daemons 1.2.5
Using deacon 1.0.0
Using polyglot 0.3.5
Using unf_ext 0.0.7.4
Using sequel 5.2.0
Using excon 0.59.0
Using facter 2.5.1
Using fast_gettext 1.5.1
Using formatador 0.2.5
Using foreman-tasks-core 0.2.4
Using get_process_mem 0.2.1
Using parse-cron 0.1.4
Using tilt 2.0.8
Using foreman_setup 5.0.0
Using net-ldap 0.16.1
Using little-plugger 1.1.4
Using mime-types-data 3.2016.0521
Using net-ping 2.0.2
Using net-ssh 4.2.0
Using netrc 0.11.0
Using oauth 0.5.3
Installing pg 0.17.1 (was 0.21.0) with native extensions
Using sexp_processor 4.10.0
Using useragent 0.16.8
Using sshkey 1.9.0
Using will_paginate 3.1.6
Using rainbow 2.2.2
Using i18n 0.9.1
Using concurrent-ruby-edge 0.2.4
Using tzinfo 1.2.4
Using nokogiri 1.8.1
Using rack-test 0.6.3
Using sprockets 3.7.1
Using rack-protection 1.4.0
Using rack-jsonp 1.3.1
Using mail 2.7.0
Using addressable 2.5.2
Using coffee-script 2.4.1
Using unf 0.1.4
Using gettext_i18n_rails 1.8.0
Using fog-core 1.45.0
Using foreman_ansible_core 1.1.1
Using logging 2.2.2
Using mime-types 3.1
Using net-scp 1.2.1
Using ruby_parser 3.10.1
Using secure_headers 3.7.3
Using dynflow 0.8.33
Using activesupport 4.2.9
Using loofah 2.1.1
Using sinatra 1.4.8
Using css_parser 1.6.0
Using domain_name 0.5.20170404
Using ruby2ruby 2.3.2
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.4.1
Using activemodel 4.2.9
Using ldap_fluff 0.4.7
Using rabl 0.13.1
Using rails-html-sanitizer 1.0.3
Using foreman-tasks 0.10.6
Using roadie 3.2.2
Using http-cookie 1.0.3
Using safemode 1.3.2
Using rails-dom-testing 1.0.8
Using activejob 4.2.9
Using activerecord 4.2.9
Using rest-client 2.0.2
Using actionview 4.2.9
Using ancestry 3.0.1
Using audited 4.5.0
Using deep_cloneable 2.3.1
Using friendly_id 5.2.3
Using scoped_search 4.1.2
Using validates_lengths_from_database 0.7.0
Using actionpack 4.2.9
Using actionmailer 4.2.9
Using railties 4.2.9
Using sprockets-rails 3.2.1
Using activerecord-session_store 1.1.0
Using coffee-rails 4.2.2
Using rails-i18n 4.0.9
Using responders 2.4.0
Using roadie-rails 1.2.1
Using webpack-rails 0.9.11
Using x-editable-rails 1.5.5
Using rails 4.2.9
Using turbolinks 2.5.3
Using apipie-rails 0.5.5
Using deface 1.2.0
Using foreman_ansible 1.4.6
Updating files in vendor/cache
  * pg-0.17.1.gem
Bundle complete! 48 Gemfile dependencies, 110 gems now installed.
Bundled gems are installed into ./vendor.
root@foremansible:/usr/share/foreman# foreman-rake db:migrate
rake aborted!
Sequel::DatabaseError: PG::DuplicateColumn: ERROR:  column "version" of relation "dynflow_schema_info" already exists
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `async_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `block in execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/logging.rb:38:in `log_connection_yield'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:109:in `check_disconnect_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:449:in `_execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block (2 levels) in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:471:in `check_database_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/connection_pool/threaded.rb:91:in `hold'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:50:in `execute_dui'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:43:in `execute_ddl'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `block in apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:424:in `apply_alter_table_generator'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:70:in `alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:622:in `schema_dataset'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:450:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:517:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:238:in `migrate_db'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:46:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `initialize_persistence'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:107:in `block in world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `tap'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:8:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:66:in `initialize_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:100:in `init_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:37:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/engine.rb:156:in `block in <class:Engine>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `instance_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:54:in `run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:352:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `public_send'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `block in require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:328:in `require_environment!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:457:in `block in run_tasks_blocks'

Caused by:
PG::DuplicateColumn: ERROR:  column "version" of relation "dynflow_schema_info" already exists
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `async_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `block in execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/logging.rb:38:in `log_connection_yield'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:145:in `execute_query'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:109:in `check_disconnect_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:133:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:449:in `_execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block (2 levels) in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:471:in `check_database_errors'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `block in execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `block in synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/connection_pool/threaded.rb:91:in `hold'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/connecting.rb:264:in `synchronize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/adapters/postgres.rb:273:in `execute'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:50:in `execute_dui'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/query.rb:43:in `execute_ddl'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `block in apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:411:in `apply_alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:424:in `apply_alter_table_generator'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/database/schema_methods.rb:70:in `alter_table'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:622:in `schema_dataset'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:450:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:517:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/sequel-5.2.0/lib/sequel/extensions/migration.rb:398:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:238:in `migrate_db'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/persistence_adapters/sequel.rb:46:in `initialize'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `new'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:39:in `initialize_persistence'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:107:in `block in world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `tap'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:103:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/dynflow/configuration.rb:8:in `world_config'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails/configuration.rb:66:in `initialize_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:100:in `init_world'
/usr/share/foreman/vendor/ruby/2.3.0/gems/dynflow-0.8.33/lib/dynflow/rails.rb:37:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/foreman-tasks-0.10.6/lib/foreman_tasks/engine.rb:156:in `block in <class:Engine>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `each'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application/finisher.rb:62:in `block in <module:Finisher>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `instance_exec'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:30:in `run'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/initializable.rb:54:in `run_initializers'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:352:in `initialize!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `public_send'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/railtie.rb:194:in `method_missing'
/usr/share/foreman/config/environment.rb:5:in `<top (required)>'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `block in require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/share/foreman/vendor/ruby/2.3.0/gems/activesupport-4.2.9/lib/active_support/dependencies.rb:274:in `require'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:328:in `require_environment!'
/usr/share/foreman/vendor/ruby/2.3.0/gems/railties-4.2.9/lib/rails/application.rb:457:in `block in run_tasks_blocks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

Same error again.

Thanks!

/Regards
Romans

Actions #8

Updated by Romans Krjukovs about 6 years ago

Don't run Bundler as root.

Crap. 8/

Should i re-run it as regular user ?

/Romans

Actions #9

Updated by yannick N about 6 years ago

Now we change Sequel Version : 5.2.0 to 4.15.0

  1. cd /usr/share/foreman
  2. nano Gemfile
  3. add gem 'sequel', '4.15.0'
    require_relative 'config/boot_settings'
    
    source 'https://rubygems.org'
    
    case SETTINGS[:rails]
    when '4.2'
      gem 'rails', '4.2.9'
    when '5.0'
      gem 'rails', '5.0.4'
      gem 'record_tag_helper', '~> 1.0'
    else
      raise "Unsupported Ruby on Rails version configured in settings.yaml: #{SETTINGS[:rails]}" 
    end
    
    gem 'sequel', '4.15.0'
    gem 'rest-client', '>= 1.8.0', '< 3', :require => 'rest_client'
    gem 'audited', '~> 4.3'
    .....
    
  4. bundle update sequel
  5. and try again foreman-rake db:migrate
Actions #10

Updated by Ewoud Kohl van Wijngaarden about 6 years ago

https://github.com/theforeman/foreman/commit/3cabaaaf6fe9362fdf524b2388b9399138dc5133 suggests at least 0.18.0 should be used. ~> 0.18 means it pulls in 0.21.0 on Debian-based distros. RH-based distros still use 0.15.1. This could point to a regression and since RH nightlies upgraded to 0.21.0 too we could be seeing issues there soon.

Actions #11

Updated by Romans Krjukovs about 6 years ago

yannick N wrote:

Now we change Sequel Version : 5.2.0 to 4.15.0

  1. cd /usr/share/foreman
  2. nano Gemfile
  3. add gem 'sequel', '4.15.0'
    [...]
  4. bundle update sequel
  5. and try again foreman-rake db:migrate

Here is the log:

root@foremansible:~# cd /usr/share/foreman
root@foremansible:/usr/share/foreman# vim Gemfile
root@foremansible:/usr/share/foreman# bundle update sequel
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies........
Using rake 12.3.0
Using concurrent-ruby 1.0.3
Using minitest 5.10.3
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Using crass 1.0.3
Using rack 1.6.8
Using mini_mime 1.0.0
Using arel 6.0.4
Using multi_json 1.12.2
Using thor 0.19.4
Using public_suffix 3.0.1
Using algebrick 0.7.5
Using apipie-params 0.0.5
Using bundler 1.11.2
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using daemons 1.2.5
Using deacon 1.0.0
Using polyglot 0.3.5
Using unf_ext 0.0.7.4
Installing sequel 4.15.0 (was 5.2.0)
Using excon 0.59.0
Using facter 2.5.1
Using fast_gettext 1.5.1
Using formatador 0.2.5
Using foreman-tasks-core 0.2.4
Using get_process_mem 0.2.1
Using parse-cron 0.1.4
Using tilt 2.0.8
Using foreman_setup 5.0.0
Using net-ldap 0.16.1
Using little-plugger 1.1.4
Using mime-types-data 3.2016.0521
Using net-ping 2.0.2
Using net-ssh 4.2.0
Using netrc 0.11.0
Using oauth 0.5.3
Using pg 0.17.1
Using sexp_processor 4.10.0
Using useragent 0.16.8
Using sshkey 1.9.0
Using will_paginate 3.1.6
Using rainbow 2.2.2
Using i18n 0.9.1
Using concurrent-ruby-edge 0.2.4
Using tzinfo 1.2.4
Using nokogiri 1.8.1
Using rack-test 0.6.3
Using sprockets 3.7.1
Using rack-protection 1.4.0
Using rack-jsonp 1.3.1
Using mail 2.7.0
Using addressable 2.5.2
Using coffee-script 2.4.1
Using unf 0.1.4
Using gettext_i18n_rails 1.8.0
Using fog-core 1.45.0
Using foreman_ansible_core 1.1.1
Using logging 2.2.2
Using mime-types 3.1
Using net-scp 1.2.1
Using ruby_parser 3.10.1
Using secure_headers 3.7.3
Using dynflow 0.8.33
Using activesupport 4.2.9
Using loofah 2.1.1
Using sinatra 1.4.8
Using css_parser 1.6.0
Using domain_name 0.5.20170404
Using ruby2ruby 2.3.2
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.4.1
Using activemodel 4.2.9
Using ldap_fluff 0.4.7
Using rabl 0.13.1
Using rails-html-sanitizer 1.0.3
Using foreman-tasks 0.10.6
Using roadie 3.2.2
Using http-cookie 1.0.3
Using safemode 1.3.2
Using rails-dom-testing 1.0.8
Using activejob 4.2.9
Using activerecord 4.2.9
Using rest-client 2.0.2
Using actionview 4.2.9
Using ancestry 3.0.1
Using audited 4.5.0
Using deep_cloneable 2.3.1
Using friendly_id 5.2.3
Using scoped_search 4.1.2
Using validates_lengths_from_database 0.7.0
Using actionpack 4.2.9
Using actionmailer 4.2.9
Using railties 4.2.9
Using sprockets-rails 3.2.1
Using activerecord-session_store 1.1.0
Using coffee-rails 4.2.2
Using rails-i18n 4.0.9
Using responders 2.4.0
Using roadie-rails 1.2.1
Using webpack-rails 0.9.11
Using x-editable-rails 1.5.5
Using rails 4.2.9
Using turbolinks 2.5.3
Using apipie-rails 0.5.5
Using deface 1.2.0
Using foreman_ansible 1.4.6
Updating files in vendor/cache
  * sequel-4.15.0.gem
Bundle updated!
root@foremansible:/usr/share/foreman# foreman-rake db:migrate
root@foremansible:/usr/share/foreman# 

No errors this time.
Let's restart the host.

Yes! Foreman started and is available from browser.
Thank You, yannick N!

Regards
/Romans

Actions #12

Updated by yannick N about 6 years ago

Good jobs Romans.
Now take a snapshot and dont touch Foreman again lol

Actions #13

Updated by Anonymous almost 6 years ago

  • Project changed from Installer to Packaging
  • Status changed from New to Duplicate
Actions #14

Updated by Anonymous almost 6 years ago

  • Related to deleted (Bug #20050: ruby-sequel-pg DEB pollutes Foreman ruby gem environment)
Actions #15

Updated by Anonymous almost 6 years ago

  • Is duplicate of Bug #20050: ruby-sequel-pg DEB pollutes Foreman ruby gem environment added
Actions

Also available in: Atom PDF