Bug 1395182

Summary: rake evm:start no longer starts the postgres service
Product: Red Hat CloudForms Management Engine Reporter: Jan Krocil <jkrocil>
Component: ApplianceAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED NOTABUG QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: abellott, jhardy, ncarboni, obarenbo
Target Milestone: GA   
Target Release: cfme-future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-18 13:44:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:

Description Jan Krocil 2016-11-15 11:08:11 UTC
Description of problem:
SSIA

Version-Release number of selected component (if applicable):
5.7.0.10

How reproducible:
always

Steps to Reproduce:
1. systemctl stop evmserverd
2. systemctl stop rh-postgresql95-postgresql
3. vmdb
4. rake evm:start (same as systemctl start evmserverd except the error is printed to stdout)

Actual results:
Starting EVM...
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `initialize'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `new'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `connect'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:721:in `new_connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:765:in `checkout_new_connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:744:in `try_to_checkout_new_connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:705:in `acquire_connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:501:in `checkout'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:875:in `retrieve_connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/connection_handling.rb:91:in `connection'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/model_schema.rb:354:in `load_schema!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/attributes.rb:233:in `load_schema!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/attribute_decorators.rb:28:in `load_schema!'
/var/www/miq/vmdb/lib/extensions/ar_virtual.rb:387:in `load_schema!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/model_schema.rb:349:in `load_schema'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/model_schema.rb:256:in `columns_hash'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/core.rb:192:in `block in find_by'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/core.rb:192:in `each'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/core.rb:192:in `all?'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/core.rb:192:in `find_by'
/var/www/miq/vmdb/app/models/miq_server.rb:528:in `block in <class:MiqServer>'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-module.rb:37:in `block (2 levels) in cache_with_timeout'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-module.rb:25:in `block in cache_with_timeout'
/var/www/miq/vmdb/app/models/miq_server/worker_management.rb:14:in `kill_all_workers'
/var/www/miq/vmdb/lib/tasks/evm_application.rb:21:in `start'
/var/www/miq/vmdb/lib/tasks/evm.rake:8:in `block (2 levels) in <top (required)>'
Tasks: TOP => evm:start
(See full trace by running task with --trace)


Expected results:
The rake task starts the database service if it's not running yet.

Additional info:
I'm not sure what the expectations are for CFME 5.7 but it used to work in the past - feel free to close if this has changed with 5.7.

Comment 2 Nick Carboni 2016-11-18 13:44:24 UTC
This behavior was removed intentionally in https://github.com/ManageIQ/manageiq/pull/10775 because it was using some ambiguous logic to determine where the database was supposed to be running which was causing issues with HA setups and containerized appliances.

Also, I think there is some value in logically separating the database from the application; as we move more towards containerization and general separation of responsibilities throughout our app I think we are going to move the application logic away from managing external services like the database.