Bug 1512840 - Reset DB configuration is failing
Summary: Reset DB configuration is failing
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: GA
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: luke couzens
Whiteboard: black
Depends On:
Blocks: 1526108
TreeView+ depends on / blocked
Reported: 2017-11-14 09:21 UTC by Ilanit Stein
Modified: 2019-02-11 13:53 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1526108 (view as bug list)
Last Closed: 2019-02-11 13:53:40 UTC
Category: Bug
Cloudforms Team: CFME Core

Attachments (Terms of Use)
reset_DB_screenshot (11.83 KB, image/png)
2017-11-14 11:32 UTC, Ilanit Stein
no flags Details

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):

How reproducible:

Steps to Reproduce:

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-, 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]

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

Thanks a lot for the tip!

Just tried it on CFME-, 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.

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:

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

 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

Note You need to log in before you can comment on or make changes to this bug.