New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB and BROKER_USE_SSL=True #1203

Closed
xando opened this Issue Feb 21, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@xando
Contributor

xando commented Feb 21, 2013

I've recently started with mongodb and BROKER_USE_SSL=True, this doesn't seem to work. Celery is trying to reconnect with Re-establishing connection message. BROKER_USE_SSL=False works well.

[2013-02-21 14:57:45,708: DEBUG/MainProcess] consumer: Re-establishing connection to the broker...
[2013-02-21 14:57:45,710: INFO/MainProcess] consumer: Connected to mongodb://localhost%3A27017%2Fdata/data.
[2013-02-21 14:57:45,714: ERROR/MainProcess] consumer: Connection to broker lost. Trying to re-establish the connection...
Traceback (most recent call last):
  File "/stuff/eggs/celery-3.0.13-py2.7.egg/celery/worker/consumer.py", line 392, in start
    self.reset_connection()
  File "/stuff/eggs/celery-3.0.13-py2.7.egg/celery/worker/consumer.py", line 741, in reset_connection
    self.connection, on_decode_error=self.on_decode_error,
  File "/stuff/eggs/celery-3.0.13-py2.7.egg/celery/app/amqp.py", line 291, in __init__
    queues or self.app.amqp.queues.consume_from.values(), **kw
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/messaging.py", line 338, in __init__
    self.revive(self.channel)
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/messaging.py", line 350, in revive
    self.declare()
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/messaging.py", line 360, in declare
    queue.declare()
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/entity.py", line 471, in declare
    self.queue_declare(nowait, passive=False)
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/entity.py", line 497, in queue_declare
    nowait=nowait)
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/transport/virtual/__init__.py", line 398, in queue_declare
    return queue, self._size(queue), 0
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/transport/mongodb.py", line 76, in _size
    return self.client.messages.find({'queue': queue}).count()
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/transport/mongodb.py", line 204, in client
    self._client = self._open()
  File "/stuff/eggs/kombu-2.5.4-py2.7.egg/kombu/transport/mongodb.py", line 133, in _open
    mongoconn = Connection(host=hostname)
  File "/stuff/eggs/pymongo-2.4.2-py2.7-linux-x86_64.egg/pymongo/connection.py", line 180, in __init__
    max_pool_size, document_class, tz_aware, _connect, **kwargs)
  File "/stuff/eggs/pymongo-2.4.2-py2.7-linux-x86_64.egg/pymongo/mongo_client.py", line 269, in __init__
    raise ConnectionFailure(str(e))
ConnectionFailure: [Errno 104] Connection reset by peer
[2013-02-21 14:57:45,716: DEBUG/MainProcess] consumer: Re-establishing connection to the broker...
[2013-02-21 14:57:45,718: INFO/MainProcess] consumer: Connected to mongodb://localhost%3A27017%2Fdata/data.
[2013-02-21 14:57:45,721: ERROR/MainProcess] consumer: Connection to broker lost. Trying to re-establish the connection...

Problem seems to be generated by this line
https://github.com/celery/kombu/blob/master/kombu/transport/mongodb.py#L135
which should take ssl=True parameter for SSL connections.

I know it's kombu component, but setting (BROKER_USE_SSL) which is leading to this problem is part of celery library.

@xando

This comment has been minimized.

Show comment
Hide comment
@xando

xando Feb 23, 2013

Contributor

Create a pull request for this as well
#1206

Contributor

xando commented Feb 23, 2013

Create a pull request for this as well
#1206

@mher mher closed this in 76fee5b Feb 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment