Bug 1093763 - pulp-manage-db stacks-dumps with no connection to mongodb
Summary: pulp-manage-db stacks-dumps with no connection to mongodb
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: 2.4 Beta
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
: 2.6.0
Assignee: amacdona@redhat.com
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-02 15:04 UTC by mkovacik
Modified: 2015-02-28 22:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:05:42 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 424 0 None None None Never

Description mkovacik 2014-05-02 15:04:16 UTC
Description of problem:
When unable to connect to the database, pulp-manage-db stack-dumps

Version-Release number of selected component (if applicable):
pulp-server-2.4.0-0.10.beta.fc20.noarch


How reproducible:
always

Steps to Reproduce:
1. mongo pulp_database --eval "db.dropDatabase()"
2. systemctl stop mongod.service
3. sudo -u apache pulp-manage-db


Actual results:
A stack dump dumped

Expected results:
Error condition properly logged by pulp-manage-db

Additional info:
# screen log
[root@ec2-54-73-48-94 pulp_auto]# systemctl stop mongod
[root@ec2-54-73-48-94 pulp_auto]# sudo -u apache pulp-manage-db
No handlers could be found for logger "pulp.server.db.connection"
Traceback (most recent call last):
  File "/bin/pulp-manage-db", line 9, in <module>
    load_entry_point('pulp-server==2.4.0', 'console_scripts', 'pulp-manage-db')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 357, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2394, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2108, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 30, in <module>
    connection.initialize()
  File "/usr/lib/python2.7/site-packages/pulp/server/db/connection.py", line 67, in initialize
    _CONNECTION = pymongo.MongoClient(seeds, **connection_kwargs)
  File "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 337, in __init__
    raise ConnectionFailure(str(e))
pymongo.errors.ConnectionFailure: could not connect to localhost:27017: [Errno 111] Connection refused

Comment 1 amacdona@redhat.com 2014-09-16 13:20:40 UTC
Appears to have been fixed from other patches.

Comment 2 Preethi Thomas 2014-09-16 16:38:44 UTC
Fails-qa
[root@qe-blade-13 ~]# rpm -qa pulp-server
pulp-server-2.4.1-0.8.beta.el6.noarch
[root@qe-blade-13 ~]# 

The it does not dump stack trace but you will have to Ctrl+C out


[root@qe-blade-13 ~]#  sudo -u apache pulp-manage-db
No handlers could be found for logger "pulp.server.db.connection"



^CTraceback (most recent call last):
  File "/usr/bin/pulp-manage-db", line 9, in <module>
    load_entry_point('pulp-server==2.4.0', 'console_scripts', 'pulp-manage-db')()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 30, in <module>
    connection.initialize()
  File "/usr/lib/python2.6/site-packages/pulp/server/db/connection.py", line 71, in initialize
    time.sleep(next_delay)
KeyboardInterrupt
[root@qe-blade-13 ~]#

Comment 3 amacdona@redhat.com 2014-09-16 19:07:51 UTC
Previous fix caused pulp-manage-db to wait for mongo if the connection cannot be made. This change allows the event to be logged and printed to the console.

Fixed by https://github.com/pulp/pulp/pull/1162

Comment 4 Chris Duryee 2014-12-23 20:53:00 UTC
fixed in pulp 2.6.0-0.2.beta

Comment 5 Preethi Thomas 2015-01-26 20:46:24 UTC
verified
[root@cloud-qe-4 yum.repos.d]# rpm -qa pulp-server
pulp-server-2.6.0-0.5.beta.el7.noarch
[root@cloud-qe-4 yum.repos.d]# 

[root@cloud-qe-4 yum.repos.d]#  systemctl stop mongod.service
[root@cloud-qe-4 yum.repos.d]#  sudo -u apache pulp-manage-db
Could not connect to MongoDB at localhost:27017:
Cannot connect to database default :
could not connect to localhost:27017: [Errno 111] Connection refused
... Waiting 1 seconds and trying again.
Could not connect to MongoDB at localhost:27017:
Cannot connect to database default :
could not connect to localhost:27017: [Errno 111] Connection refused
... Waiting 1 seconds and trying again.
Could not connect to MongoDB at localhost:27017:
Cannot connect to database default :

Comment 6 Brian Bouterse 2015-02-28 22:05:42 UTC
Moved to https://pulp.plan.io/issues/424


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