Bug 1445819

Summary: appliance_console crash when setting up standby node with no route to host
Product: Red Hat CloudForms Management Engine Reporter: luke couzens <lcouzens>
Component: ApplianceAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED CURRENTRELEASE QA Contact: luke couzens <lcouzens>
Severity: medium Docs Contact:
Priority: high    
Version: 5.8.0CC: abellott, dajohnso, gtanzill, jhardy, obarenbo, simaishi, yrudman
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: HA:black
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1496900 (view as bug list) Environment:
Last Closed: 2018-03-06 15:11:40 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1496900    

Description luke couzens 2017-04-26 15:03:25 UTC
Description of problem:appliance_console crash when setting up standby node with no route to host


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


How reproducible:100%


Steps to Reproduce:
1.provision appliance
2.setup standby node
3.pass in bogus primary node ip

Actual results:
Establish Replication Standby Server
Appliance database found under: /var/opt/rh/rh-postgresql95/lib/pgsql/data
Replication standby server can not be configured if the database already exists
Would you like to remove the existing database before configuring as a standby
server?
  WARNING: This is destructive. This will remove all previous data from this
server
Continue? (Y/N): y
No partition found for Standby database disk. You probably want to add an
unpartitioned disk and try again.
Are you sure you don't want to partition the Standby database disk? (Y/N): y
Enter the number uniquely identifying this node in the replication cluster: 1
Enter the cluster database name: |vmdb_production| 
Enter the cluster database username: |root| 
Enter the cluster database password: *******
Enter the cluster database password: *******
Enter the primary database hostname or IP address: ******
Enter the Standby Server hostname or IP address: |******| ******
Configure Replication Manager (repmgrd) for automatic failover? (Y/N): y
/opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console/database_replication_standby.rb:132:in `initialize': could not connect to server: No route to host (PG::ConnectionBad)
	Is the server running on host "*******" and accepting
	TCP/IP connections on port 5432?
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console/database_replication_standby.rb:132:in `new'
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console/database_replication_standby.rb:132:in `record_for_node_number'
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console/database_replication_standby.rb:120:in `node_number_valid?'
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console/database_replication_standby.rb:38:in `ask_questions'
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console.rb:555:in `block in <module:ApplianceConsole>'
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console.rb:108:in `loop'
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console.rb:108:in `<module:ApplianceConsole>'
	from /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-12fcafd08821/lib/gems/pending/appliance_console.rb:99:in `<top (required)>'
	from /usr/bin/appliance_console:10:in `require'
	from /usr/bin/appliance_console:10:in `<main>'

Expected results: Error message such as, 'No route to host, please check and retype ip address'


Additional info:

Comment 3 CFME Bot 2017-07-06 22:13:09 UTC
New commit detected on ManageIQ/manageiq-gems-pending/master:
https://github.com/ManageIQ/manageiq-gems-pending/commit/ecfa5bb02c1ffa531e3fdfcbe8347901b43ef644

commit ecfa5bb02c1ffa531e3fdfcbe8347901b43ef644
Author:     Bo Yao <boyao>
AuthorDate: Wed Jul 5 17:06:16 2017 -0400
Commit:     Bo Yao <boyao>
CommitDate: Thu Jul 6 16:33:21 2017 -0400

    handle PG::ConnectionBad for database_replication_standby
    https://bugzilla.redhat.com/show_bug.cgi?id=1445819

 lib/gems/pending/appliance_console/database_replication_standby.rb | 6 ++++++
 1 file changed, 6 insertions(+)

Comment 7 luke couzens 2017-10-12 12:01:40 UTC
Verified in 5.9.0.2