Bug 852852 - Katello resetdbs does not error if db connections exist.
Katello resetdbs does not error if db connections exist.
Product: Katello
Classification: Community
Component: Infrastructure (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Justin Sherrill
Katello QA List
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2012-08-29 15:08 EDT by Justin Sherrill
Modified: 2012-11-07 11:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-11-07 11:11:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Justin Sherrill 2012-08-29 15:08:50 EDT
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 09:44:52 EDT
FYI this is a devel only script. It's not distributed.
Comment 2 Justin Sherrill 2012-08-30 09:53:55 EDT
True, maybe it'd be a better fit in the katello project bz realm.
Comment 3 Mike McCune 2012-11-07 11:11:11 EST
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.