Bug 852852 - Katello resetdbs does not error if db connections exist.
Summary: Katello resetdbs does not error if db connections exist.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Katello
Classification: Retired
Component: Infrastructure
Version: 1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Justin Sherrill
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-29 19:08 UTC by Justin Sherrill
Modified: 2012-11-07 16:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-07 16:11:11 UTC
Embargoed:


Attachments (Terms of Use)

Description Justin Sherrill 2012-08-29 19:08:50 UTC
Description of problem:

When running katello-reset-dbs if any process is using the db, a warning is printed to the screen, but the process continues.  If you are not watching carefully it appears that all is cleared when in fact it wasn't.


 ** Invoke setup (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke check_db_config (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute check_db_config
** Invoke clear_search_indices (first_time)
** Execute clear_search_indices
Search Indices cleared.
** Invoke db:migrate:reset (first_time)
** Invoke db:drop (first_time)
** Invoke db:load_config 
** Execute db:drop
Couldn't drop katelloschema : #<ActiveRecord::StatementInvalid: PGError: ERROR:  database "katelloschema" is being accessed by other users
DETAIL:  There are 1 other session(s) using the database.
: DROP DATABASE IF EXISTS "katelloschema">
** Invoke db:create (first_time)
** Invoke db:load_config 
** Execute db:create
katelloschema_test already exists
katelloschema already exists
** Invoke db:migrate (first_time)
** Invoke environment 
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment 
** Execute db:schema:dump
** Execute db:migrate:reset
** Invoke seed_with_logging (first_time)
** Invoke db:seed (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment 
** Execute db:abort_if_pending_migrations
** Execute db:seed
** Execute seed_with_logging
** Execute setup
Database sucessfully recreated in development

Comment 1 Lukas Zapletal 2012-08-30 13:44:52 UTC
FYI this is a devel only script. It's not distributed.

Comment 2 Justin Sherrill 2012-08-30 13:53:55 UTC
True, maybe it'd be a better fit in the katello project bz realm.

Comment 3 Mike McCune 2012-11-07 16:11:11 UTC
we are going to be dropping katello-reset-dbs and using katello-configure --reset-data instead


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