Bug 1270782 - PG::ObjectInUse: ERROR: database "vmdb_production" is being accessed by other users when resetting database region
PG::ObjectInUse: ERROR: database "vmdb_production" is being accessed by othe...
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance (Show other bugs)
5.5.0
Unspecified Unspecified
high Severity medium
: GA
: 5.5.0
Assigned To: Nick Carboni
Aziza Karol
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-12 07:36 EDT by Aziza Karol
Modified: 2015-12-08 08:37 EST (History)
4 users (show)

See Also:
Fixed In Version: 5.5.0.8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-08 08:37:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Aziza Karol 2015-10-12 07:36:42 EDT
Description of problem:
Initially the database region was set to 0, I was trying to reset the database region.

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

How reproducible:
100%

Steps to Reproduce:
1.ssh into appliance
2.execute #appliance_console
3.select option 7 to setup database region

Choose the advanced setting: 7

Setup Database Region

Checking for connections to the database...

Setup Database Region

Note: Each database region number must be unique.

Enter the database region number: 2


It is recommended to use a new database or backup the existing database first.
Warning: SETTING A DATABASE REGION WILL DESTROY ANY EXISTING DATA AND CANNOT BE
UNDONE.

Setting Database Region to: 1
Are you sure you want to continue? (Y/N): y
Setting Database Region...  This process may take a few minutes.
Press any key to continue.


Actual results:
"PG::ObjectInUse: ERROR:  database "vmdb_production" is being accessed by other
users 
ERROR -- : PG::DuplicateDatabase: ERROR:  database "vmdb_production" already exists
: CREATE DATABASE "vmdb_production" ENCODING = 'utf8'"
 in production.log

Expected results:


Additional info:
error in console:
An error occurred:
PG::ObjectInUse: ERROR:  database "vmdb_production" is being accessed by other
users
DETAIL:  There are 14 other sessions using the database.
: DROP DATABASE IF EXISTS "vmdb_production"
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/connection_adapter
s/postgresql/database_statements.rb:155:in `async_exec'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/connection_adapter
s/postgresql/database_statements.rb:155:in `block in execute'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/connection_adapter
s/abstract_adapter.rb:473:in `block in log'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/notifications/in
strumenter.rb:20:in `instrument'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/connection_adapter
s/abstract_adapter.rb:467:in `log'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/connection_adapter
s/postgresql/database_statements.rb:154:in `execute'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/connection_adapter
s/postgresql/schema_statements.rb:86:in `drop_database'

-- press enter/return to continue or q to stop -- 
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/tasks/postgresql_d
atabase_tasks.rb:30:in `drop'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/tasks/database_tas
ks.rb:114:in `drop'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/tasks/database_tas
ks.rb:128:in `block in drop_current'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/tasks/database_tas
ks.rb:275:in `block in each_current_configuration'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/tasks/database_tas
ks.rb:274:in `each'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/tasks/database_tas
ks.rb:274:in `each_current_configuration'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/tasks/database_tas
ks.rb:127:in `drop_current'
/opt/rh/cfme-gemset/gems/activerecord-4.2.4/lib/active_record/railties/databases
.rake:28:in `block (2 levels) in <top (required)>'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in

-- press enter/return to continue or q to stop -- 
invoke_with_call_chain'
/opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:172:in
`invoke_with_call_chain'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/www/miq/vmdb/lib/tasks/evm_dba.rake:141:in `block (3 levels) in <top
(required)>'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in
invoke_with_call_chain'
/opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:172:in
`invoke_with_call_chain'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:201:in `block in
invoke_prerequisites'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:199:in `each'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:199:in
`invoke_prerequisites'

-- press enter/return to continue or q to stop -- 
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:178:in `block in
invoke_with_call_chain'
/opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:172:in
`invoke_with_call_chain'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/www/miq/vmdb/lib/tasks/evm_dba.rake:178:in `block (3 levels) in <top
(required)>'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in
invoke_with_call_chain'
/opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:172:in
`invoke_with_call_chain'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:150:in
`invoke_task'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2
-- press enter/return to continue or q to stop -- 
levels) in top_level'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in
top_level'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:115:in
`run_with_threads'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in
run'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:176:in
`standard_exception_handling'
/opt/rh/cfme-gemset/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/opt/rh/cfme-gemset/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:
268:in `load'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:
268:in `block in load'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:
240:in `load_dependency'
/opt/rh/cfme-gemset/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:
268:in `load'
Comment 2 Nick Carboni 2015-10-21 16:54:37 EDT
https://github.com/ManageIQ/manageiq/pull/5036
Comment 6 CFME Bot 2015-10-21 17:28:02 EDT
New commit detected on ManageIQ/manageiq-appliance-build/master:
https://github.com/ManageIQ/manageiq-appliance-build/commit/a94f2d89e4145d75c9a1132471a901b846bb8eed

commit a94f2d89e4145d75c9a1132471a901b846bb8eed
Author:     Nick Carboni <ncarboni@redhat.com>
AuthorDate: Wed Oct 21 16:50:18 2015 -0400
Commit:     Nick Carboni <ncarboni@redhat.com>
CommitDate: Wed Oct 21 16:50:18 2015 -0400

    Using client_connections rather than database_connections for count
    
    Connection object did not respond to #database_connections causing
    an error when attempting to set database region.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1270782

 lib/evm_database_ops.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 7 CFME Bot 2015-10-26 16:48:55 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/1cf4d98aae8ded3dff21d95621979e696a85cd61

commit 1cf4d98aae8ded3dff21d95621979e696a85cd61
Author:     Nick Carboni <ncarboni@redhat.com>
AuthorDate: Wed Oct 21 16:50:18 2015 -0400
Commit:     Nick Carboni <ncarboni@redhat.com>
CommitDate: Thu Oct 22 08:34:50 2015 -0400

    Using client_connections rather than database_connections for count
    
    Connection object did not respond to #database_connections causing
    an error when attempting to set database region.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1270782

 lib/evm_database_ops.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 8 Aziza Karol 2015-11-12 04:56:51 EST
Able to reset database region.

Verified:5.5.0.10-beta2.1.20151110134042_d6f5459
Comment 10 errata-xmlrpc 2015-12-08 08:37:32 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551

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