Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1512840

Summary: Reset DB configuration is failing
Product: Red Hat CloudForms Management Engine Reporter: Ilanit Stein <istein>
Component: ApplianceAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED CURRENTRELEASE QA Contact: luke couzens <lcouzens>
Severity: high Docs Contact:
Priority: medium    
Version: 5.9.0CC: abellott, dagur, dajohnso, gtanzill, istein, jhardy, obarenbo, simaishi, smallamp, yrudman
Target Milestone: GAKeywords: TestOnly
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: black
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1526108 (view as bug list) Environment:
Last Closed: 2019-02-11 13:53:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core
Bug Depends On:    
Bug Blocks: 1526108    
Attachments:
Description Flags
reset_DB_screenshot none

Description Ilanit Stein 2017-11-14 09:21:05 UTC
Description of problem:
On CFME-5.8/5.9, there seem to be a problem of performing Reset DB configuration.
On CFME-5.9 it is failing eventually on existing DB connections.

Version-Release number of selected component (if applicable):
CFME-5.9.0.4, CFME-5.8.2.3

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Not sure if this is a regression.

Comment 2 Oleg Barenboim 2017-11-14 09:48:09 UTC
Can you be more specific about the steps to reproduce and provide logs/screenshots (if applicable)?

Comment 3 Ilanit Stein 2017-11-14 11:28:31 UTC
Have a CFME-5.9.0.4, connected to RHV-4.1 provider.
Run the following commands:

$ appliance_console,
5)Configure Database
4)Reset Configured Database
Enter database region number:-> Enter the region number that was entered when DB was configured

Getting in response:
Checking for connections to the database...

Warning: There are 19 existing connections to the database preventing the setup of a database region.

Press any key to continue. 

(Screenshot attached)

* Couldn't find any relevant log, that document this failure.

Comment 4 Ilanit Stein 2017-11-14 11:32:24 UTC
Created attachment 1351909 [details]
reset_DB_screenshot

Comment 5 Yuri Rudman 2017-11-14 23:08:14 UTC
Execute "15) Stop EVM Server Processes" from appliance_console first - it should close open connections to DB.

Comment 6 Ilanit Stein 2017-11-15 07:35:40 UTC
Yuri,

Thanks a lot for the tip!

Just tried it on CFME-5.8.2.3, and was able to Reset the configured DB.

I am aware of at least 4 people, that met this problem, recently, 
but weren't aware to this solution. 

IMO, If we could have this tip displayed, 
when trying to reset the configured DB, 
aside to the "Warning: There are 19 existing connections...",
it would be very helpful. 
What do you think, can we add it please?

btw, do you know if this flow is documented in the CFME docs?

Comment 7 Ilanit Stein 2017-11-15 07:52:13 UTC
Found another related problem.
After running reset configured DB successfully.
I then tried to run Configure the Database,
and I chose same region number that was set, before the reset. 
The Configure Database failed as follows:


Activating the configuration using the following settings...
Host:     localhost
Username: root
Database: vmdb_production
Region:   0

An internal database already exists.
Choose "Reset Internal Database" to reset the existing installation
Configuration failed

Press any key to continue.


Yuri,
Can you please advise?

Comment 8 Ilanit Stein 2017-11-15 08:15:40 UTC
In continue to comment 7, 
Running 16) Start EVM Server Processes, allowed to connect to the UI, without Configuring the Database, as mentioned above, as it failed.

Comment 9 Yuri Rudman 2017-11-15 13:08:29 UTC
Ilanit,  I guess taht last sentence "Configuration failed" slightly confusing and may be need to be deleted since there is no any changes made to existing configuration.

Comment 10 Bo Yao 2017-11-15 14:14:00 UTC
(In reply to Yuri Rudman from comment #9)
> Ilanit,  I guess taht last sentence "Configuration failed" slightly
> confusing and may be need to be deleted since there is no any changes made
> to existing configuration.

This and good hint for reset external db is not difficult to fix. But for internal one in Comment 7, is that by intention? Thanks

Comment 11 Yuri Rudman 2017-11-15 14:33:39 UTC
Bo, the best fix for Comment 7 is to find-out that internal DB already exists and show appropriate message without asking many question (user, password, etc..) and after that saying sorry, db already exists

Comment 13 CFME Bot 2017-11-17 14:14:59 UTC
New commit detected on ManageIQ/manageiq-appliance_console/master:
https://github.com/ManageIQ/manageiq-appliance_console/commit/bbfd3a8c3520df1811f305572344cd9e96bf0aa0

commit bbfd3a8c3520df1811f305572344cd9e96bf0aa0
Author:     Bo Yao <icerove@gmail.com>
AuthorDate: Wed Nov 15 09:55:02 2017 -0500
Commit:     Bo Yao <icerove@gmail.com>
CommitDate: Fri Nov 17 08:58:24 2017 -0500

    hint for reset db with appliances connected
    https://bugzilla.redhat.com/show_bug.cgi?id=1512840

 lib/manageiq/appliance_console/database_configuration.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comment 14 Satoe Imaishi 2017-12-14 18:54:11 UTC
PR to bump manageiq-appliance_console version: https://github.com/ManageIQ/manageiq-appliance/pull/163

Comment 17 luke couzens 2018-06-18 11:49:55 UTC
Verified in 5.10