Description of problem: On the first boot of an appliance, no database is configured which in turn means that there is no config/database.yml file. When the evmserverd service (rails app) starts it blows up because that file is necessary. Version-Release number of selected component (if applicable): 5.5.0.6 How reproducible: Always Steps to Reproduce: 1. Boot 2. 3. Actual results: Many backtraces in /var/log/messages (about one every 3 seconds as systemd tries to get the service to start) Expected results: The application should hold off on starting until a database disk is configured Additional info: Backtrace: Oct 16 17:14:43 new-host systemd: Starting EVM server daemon... Oct 16 17:14:46 new-host sh: /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/application/configuration.rb:110:in `database_configuration': Cannot load `Rails.application.database_configuration`: (RuntimeError) Oct 16 17:14:46 new-host sh: Could not load database configuration. No such file - ["config/database.yml"] Oct 16 17:14:46 new-host sh: from /var/www/miq/vmdb/config/environments/patches/database_configuration.rb:15:in `database_configuration' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:27:in `each' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/lazy_load_hooks.rb:27:in `on_load' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/railtie.rb:116:in `block in <class:Railtie>' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `instance_exec' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/initializable.rb:30:in `run' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/initializable.rb:55:in `block in run_initializers' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:226:in `block in tsort_each' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:429:in `each_strongly_connected_component_from' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:347:in `block in each_strongly_connected_component' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in `each' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in `call' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:345:in `each_strongly_connected_component' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:224:in `tsort_each' Oct 16 17:14:46 new-host sh: from /opt/rh/rh-ruby22/root/usr/share/ruby/tsort.rb:203:in `tsort_each' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/initializable.rb:54:in `run_initializers' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/application.rb:352:in `initialize!' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/railtie.rb:194:in `public_send' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/railtie.rb:194:in `method_missing' Oct 16 17:14:46 new-host sh: from /var/www/miq/vmdb/config/environment.rb:5:in `<top (required)>' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/application.rb:328:in `require_environment!' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/commands/runner.rb:52:in `<top (required)>' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:123:in `require' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:123:in `require_command!' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:90:in `runner' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!' Oct 16 17:14:46 new-host sh: from /opt/rh/cfme-gemset/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>' Oct 16 17:14:46 new-host sh: from /var/www/miq/vmdb/script/rails:6:in `require' Oct 16 17:14:46 new-host sh: from /var/www/miq/vmdb/script/rails:6:in `<main>' Oct 16 17:14:46 new-host systemd: evmserverd.service: control process exited, code=exited status=1 Oct 16 17:14:46 new-host systemd: Failed to start EVM server daemon. Oct 16 17:14:46 new-host systemd: Unit evmserverd.service entered failed state. Oct 16 17:14:46 new-host systemd: evmserverd.service holdoff time over, scheduling restart. Oct 16 17:14:46 new-host systemd: Stopping EVM server daemon...
The fix for this would be for the evmserverd service to be disabled by default on downstream appliances. That way we could enable and start(?) the service only when the database has been successfully created.
https://github.com/ManageIQ/manageiq/pull/4989
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/7321142247a523d062a248e1a37862e2f8f1e06f commit 7321142247a523d062a248e1a37862e2f8f1e06f Author: Nick Carboni <ncarboni> AuthorDate: Tue Oct 20 08:52:10 2015 -0400 Commit: Nick Carboni <ncarboni> CommitDate: Tue Oct 20 11:01:04 2015 -0400 Enable and start the evmserverd service after the database is configured https://bugzilla.redhat.com/show_bug.cgi?id=1272604 gems/pending/appliance_console/database_configuration.rb | 1 + gems/pending/spec/appliance_console/database_configuration_spec.rb | 4 ++++ 2 files changed, 5 insertions(+)
https://github.com/ManageIQ/manageiq/pull/4738
https://github.com/ManageIQ/manageiq/pull/4731
https://github.com/ManageIQ/manageiq/pull/4916
https://github.com/ManageIQ/manageiq/pull/4939
https://github.com/ManageIQ/manageiq-appliance-build/pull/69
https://github.com/ManageIQ/manageiq/pull/4936
New commit detected on ManageIQ/manageiq-appliance-build/master: https://github.com/ManageIQ/manageiq-appliance-build/commit/029b53619225cfec48e12c4df413d31df843ea42 commit 029b53619225cfec48e12c4df413d31df843ea42 Author: Nick Carboni <ncarboni> AuthorDate: Tue Oct 20 16:04:38 2015 -0400 Commit: Nick Carboni <ncarboni> CommitDate: Tue Oct 20 16:04:38 2015 -0400 Remove the line that enables evmserverd The service will be enabled and started after the database is configured by the changes in https://github.com/ManageIQ/manageiq/pull/4989 https://bugzilla.redhat.com/show_bug.cgi?id=1272604 kickstarts/partials/post/systemd.ks.erb | 1 - 1 file changed, 1 deletion(-)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2015:2551