Kombu: AttributeError: 'ChannelPromise' object has no attribute '__value__'

Created on 10 Jun 2014  路  28Comments  路  Source: celery/kombu

pip freeze:

-e git://github.com/django/django.git@df09d854828bcff56eb72f48ff1ba8fce7e90c90#egg=Django-origin/HEAD
Jinja2==2.7.3
MarkupSafe==0.23
-e git://github.com/python-imaging/Pillow@24cb7bf3df6660bb2bd705b3197e97947dd40a50#egg=Pillow-dev
PyYAML==3.11
Pygments==1.6
Unidecode==0.04.16
-e git://github.com/celery/py-amqp.git@6b945b7065bd3bc53142e2d3f1d520d6f4a3d2de#egg=amqp-origin/master
anyjson==0.3.3
argparse==1.2.1
-e git://github.com/celery/billiard.git@0c8b96c47551f4f0d2d58c53dda7251bcf03236c#egg=billiard-origin/HEAD
bpython==0.12
-e git://github.com/celery/celery.git@2391c30d13c03ba778cdb58208aeb70040fbc9cf#egg=celery-origin/HEAD
chardet==2.0.1
colorama==0.2.5
command-not-found==0.3
-e git://github.com/SimonSapin/cssselect.git@f7b38ba6446d06ba3ed815729e65229532cd1818#egg=cssselect-origin/HEAD
defer==1.0.6
-e git://github.com/django-admin-bootstrapped/django-admin-bootstrapped.git@cbb567b85d0800ec9ed4da07004bde91d2a22e5a#egg=django_admin_bootstrapped-origin/master
-e git://github.com/davidfischer-ch/django-allauth.git@42ccb12701609b2b213e0c1128be374413678ff1#egg=django_allauth-origin/master
django-appconf==0.6
-e git://github.com/brack3t/django-braces.git@c4491e223ba56e22489ac26f4bc17d674eae34f2#egg=django_braces-origin/HEAD
-e git://github.com/davidfischer-ch/django-celery.git@1509614cdccedabb86217ee92677d495dbac1270#egg=django_celery-origin/dev
-e git://github.com/django-compressor/django-compressor.git@67f5de2cf503e2c375e5fe36f050b8dfa8cba145#egg=django_compressor-origin/develop
-e git://github.com/davidfischer-ch/django-crispy-forms.git@568b60cc8073740221f133390b2dd921c442da6b#egg=django_crispy_forms-origin/HEAD
-e git://github.com/morninj/django-email-obfuscator.git@02cee5f7bc0c3798ec2f4e154eb0c9aebcf2ae4f#egg=django_email_obfuscator-origin/master
-e git://github.com/django-extensions/django-extensions.git@f7b1bb51aba9a5b749e6964833b429faf948e74d#egg=django_extensions-dev
-e git://github.com/alex/django-filter.git@d88b98dd2b70551deb9c128b209fcf783b325acc#egg=django_filter-develop
-e git://github.com/evonove/django-oauth-toolkit.git@324cd9cd22833a038306f462a00f912b062f4519#egg=django_oauth_toolkit-origin/HEAD
django-phonenumber-field==0.5
-e git://github.com/davidfischer-ch/django-sendfile.git@7f79b124c6153a200116906a72110069f0eac268#egg=django_sendfile-dev
-e git://github.com/mbi/django-simple-captcha.git@47260b8b4c416bc5c5781e1724103d0c9c1cb4f6#egg=django_simple_captcha-origin/master
-e git://github.com/davidfischer-ch/django-rest-framework.git@b2e07d8613c289e14b2054e1e76837c29807595e#egg=djangorestframework-namespace
html5lib==0.999
-e git://github.com/celery/kombu.git@244b882e0c103b915e98de6ebb7d0cb026974515#egg=kombu-origin/HEAD
language-selector==0.1
lxml==3.3.5
mock==1.0.1
oauthlib==0.6.1
passlib==1.6.2
phonenumbers==6.1.0
psycopg2==2.5.3
pyaml==14.05.7
pycallgraph==1.0.1
pycurl==7.19.3
pygal==1.4.6
pygobject==3.12.0
pymongo==2.7.1
python-apt==0.9.3.5
python3-openid==3.0.4
pytoolbox==8.3.3-beta
pytz==2014.4
requests==2.2.1
requests-oauthlib==0.4.1
selenium==2.41.0
sendgrid==0.5.1
-e git://github.com/elbuo8/sendgrid-django.git@b026123f6dac27de9f67b95c2c9ef172bda53c2a#egg=sendgrid_django-origin/master
six==1.5.2
slumber==0.7.1.dev
smtpapi==0.1.2
-e git://github.com/davidfischer-ch/splinter.git@3d4924e1ac48b3e8968050246b0e77711f3f635c#egg=splinter-origin/HEAD
uWSGI==2.0.5.1
ufw==0.34-rc-0ubuntu2
unattended-upgrades==0.1
unittest2py3k==0.5.1
urllib3==1.7.1
-e git://github.com/alecthomas/voluptuous.git@0873a4d1f542997fcb6849fdfc0f68d66d7b7f18#egg=voluptuous-dev

Traceback:

Traceback (most recent call last):
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/utils/__init__.py", line 405, in __call__
    return self.__value__
AttributeError: 'ChannelPromise' object has no attribute '__value__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/cloudncode/venv/src/django/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django-braces/braces/views/_access.py", line 66, in dispatch
    request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/edit.py", line 205, in post
    return super(BaseCreateView, self).post(request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/edit.py", line 171, in post
    return self.form_valid(form)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/edit.py", line 147, in form_valid
    self.object = form.save()
  File "/home/ubuntu/cloudncode/server/cloudncode_base/forms/encoding.py", line 42, in save
    instance.launch()
  File "/home/ubuntu/cloudncode/server/cloudncode_base/models/encoding.py", line 89, in launch
    tasks.EncodingTask().apply_async(kwargs={'task_pk': self.pk}, task_id=self.meta_id)
  File "/home/ubuntu/cloudncode/venv/src/celery/celery/app/task.py", line 462, in apply_async
    **dict(self._get_exec_options(), **options)
  File "/home/ubuntu/cloudncode/venv/src/celery/celery/app/base.py", line 383, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "/home/ubuntu/cloudncode/venv/src/celery/celery/app/amqp.py", line 468, in publish_task
    **properties
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 168, in publish
    routing_key, mandatory, immediate, exchange, declare)
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 436, in _ensured
    return fun(*args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 173, in _publish
    channel = self.channel
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 190, in _get_channel
    channel = self._channel = channel()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/utils/__init__.py", line 407, in __call__
    value = self.__value__ = self.__contract__()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 205, in <lambda>
    channel = ChannelPromise(lambda: connection.default_channel)
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 756, in default_channel
    self.connection
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 741, in connection
    self._connection = self._establish_connection()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 696, in _establish_connection
    conn = self.transport.establish_connection()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/transport/pyamqp.py", line 112, in establish_connection
    conn = self.Connection(**opts)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 217, in __init__
    self.connect()
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 236, in connect
    self.drain_events()
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 354, in drain_events
    return self.blocking_read(timeout)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 359, in blocking_read
    return self.on_inbound_frame(read_frame())
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/method_framing.py", line 65, in frame_handler
    callback(channel, method_sig, buf, None)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 385, in on_inbound_method
    method_sig, payload, content,
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/abstract_channel.py", line 124, in dispatch_method
    args, _ = loads(amqp_method.args, payload, 4)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/serialization.py", line 229, in loads
    val[key], offset = _read_item(buf, offset)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/serialization.py", line 154, in _read_item
    ftype, type(ftype)))
amqp.exceptions.FrameSyntaxError: Unknown value in table: 70 (<class 'int'>)
ERROR Internal Server Error: /fr/encoding/task/create
Traceback (most recent call last):
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/utils/__init__.py", line 405, in __call__
    return self.__value__
AttributeError: 'ChannelPromise' object has no attribute '__value__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/cloudncode/venv/src/django/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django-braces/braces/views/_access.py", line 66, in dispatch
    request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/edit.py", line 205, in post
    return super(BaseCreateView, self).post(request, *args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/edit.py", line 171, in post
    return self.form_valid(form)
  File "/home/ubuntu/cloudncode/venv/src/django/django/views/generic/edit.py", line 147, in form_valid
    self.object = form.save()
  File "/home/ubuntu/cloudncode/server/cloudncode_base/forms/encoding.py", line 42, in save
    instance.launch()
  File "/home/ubuntu/cloudncode/server/cloudncode_base/models/encoding.py", line 89, in launch
    tasks.EncodingTask().apply_async(kwargs={'task_pk': self.pk}, task_id=self.meta_id)
  File "/home/ubuntu/cloudncode/venv/src/celery/celery/app/task.py", line 462, in apply_async
    **dict(self._get_exec_options(), **options)
  File "/home/ubuntu/cloudncode/venv/src/celery/celery/app/base.py", line 383, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "/home/ubuntu/cloudncode/venv/src/celery/celery/app/amqp.py", line 468, in publish_task
    **properties
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 168, in publish
    routing_key, mandatory, immediate, exchange, declare)
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 436, in _ensured
    return fun(*args, **kwargs)
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 173, in _publish
    channel = self.channel
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 190, in _get_channel
    channel = self._channel = channel()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/utils/__init__.py", line 407, in __call__
    value = self.__value__ = self.__contract__()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/messaging.py", line 205, in <lambda>
    channel = ChannelPromise(lambda: connection.default_channel)
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 756, in default_channel
    self.connection
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 741, in connection
    self._connection = self._establish_connection()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/connection.py", line 696, in _establish_connection
    conn = self.transport.establish_connection()
  File "/home/ubuntu/cloudncode/venv/src/kombu/kombu/transport/pyamqp.py", line 112, in establish_connection
    conn = self.Connection(**opts)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 217, in __init__
    self.connect()
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 236, in connect
    self.drain_events()
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 354, in drain_events
    return self.blocking_read(timeout)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 359, in blocking_read
    return self.on_inbound_frame(read_frame())
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/method_framing.py", line 65, in frame_handler
    callback(channel, method_sig, buf, None)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/connection.py", line 385, in on_inbound_method
    method_sig, payload, content,
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/abstract_channel.py", line 124, in dispatch_method
    args, _ = loads(amqp_method.args, payload, 4)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/serialization.py", line 229, in loads
    val[key], offset = _read_item(buf, offset)
  File "/home/ubuntu/cloudncode/venv/src/py-amqp/amqp/serialization.py", line 154, in _read_item
    ftype, type(ftype)))
amqp.exceptions.FrameSyntaxError: Unknown value in table: 70 (<class 'int'>)
Not a Bug

Most helpful comment

I solved it. Here's the steps that worked for me:

pip install dramatiq

All 28 comments

Thanks! Is this the py-amqp master branch?

The bug is not in ChannelPromise, it will raise AttributeError there when the promise has not been evaluated, so the second exception is the real issue.

Indeed, I am still not used to read Python 3 traceback with raise from :-)

Here is the exact commit of py-ampq: -e git://github.com/celery/py-amqp.git@6b945b7065bd3bc53142e2d3f1d520d6f4a3d2de#egg=py-amqp.

I am also using a modified django-celery, but I do not think the issue is related to this.
Tested with djcelery 398fb4 and e92581ba.

It seems you are using amqp master? This is not yet stable, you should be using 1.4.x

Python 3 issue, we will be porting the development changes to py3 soon

I'm still seeing this in 3.0.33 (with aqmp 1.4.9). With this issue closed, is this being tracked?

This was supposedly fixed in 3.0.15, I also just received it though. (amqp 1.4.9, kombu 3.0.33)

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/kombu/utils/__init__.py", line 423, in __call__
    return self.__value__
AttributeError: 'ChannelPromise' object has no attribute '__value__'

I'm not sure why, but it seems like the AttributeError isn't being caught here for some reason?

Any news on this? I'm getting the same error. How should we procede?

@fwachs: Can you make sure the code can actually connect to your Rabbit server, cuz it seems like I was actually getting this error somehow because of that?

It's not connecting to the rabbit server actually. It doesn't matter what parameter I use, It will try to connect to localhost instead of the string I set.

@fwachs Hello ! I'm getting the error too. It seems that it does not even try to connect and crashs before. Did you find any workaround ?
Thanks.

I am also encountering this exception. I'd love to learn of a workaround.

Do you have the exact same traceback? What version of Python? The AttributeError is clearly being catched so that error message has nothing to do with the real error.

I actually tracked it down to not setting the AMQP host correctly when configuring Celery. I inherited a Django app with some code that looks something like this:

app = Celery('app_name', broker='amqp://')
class config:
    BROKER_URL = 'amqp://a_real_host:5672/'
app.config_from_object(config)

The broker URL from config wasn't overriding what was passed in to Celery (not sure whether this is desired behavior but it seems fine to me). Whenever some code would try to invoke a task, it would fail trying to connect to localhost.

To be clear--it was most certainly a problem in my own code, which I've since fixed. Hopefully this will help someone else.

@fwachs I also ran into this. The problem was that celery was not being initialized in the django app.

http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html

The celery client was trying to connect to amqp://127.0.0.1:5672 which caused the stacktrace similar to the one originally reported.

I run into this error when the broker is not yet online. I am running a worker, a master, and a rabbitmq broker in separate containers with docker-compose. If I put a sleep before the first time I call celery_instance.send_task in the master (basically waiting until the broker has fully started), then it connects fine. However if I take out the sleep, so that I begin trying to connect while the broker is still turning on, and the broker port has not been bound yet, then I see a similar stacktrace. Is the celery instance not being initialized correctly in the master, as dpetzold indicates? Because adding only a sleep of ~10 seconds before the call to send_task without changing any configuration or code makes it work, which makes me believe that I am configuring celery for my connection correctly.

In this case I would really like to inherit the default retry logic that my worker celery process seems to have:

http_worker_1 | [2016-08-14 20:49:57,786: ERROR/MainProcess] consumer: Cannot connect to amqp://myusername:**@rabbitmq:5672//: [Errno 111] Connection refused.
http_worker_1 | Trying again in 6.00 seconds...
http_worker_1 | 

I am running on alpine:3.4
Python 3.5.1
amqp==1.4.9
anyjson==0.3.3
billiard==3.3.0.23
celery==3.1.23
kombu==3.0.35
pytz==2016.6.1
requests==2.11.0

@tmehlinger you saved my day thanks! I now import the app object directly from MY celery.py that actually reads up the project's settings.py

can any of you send a fix or documentation improvement to avoid this error?

+1

In my case, mq was not running. After I execute it, the error message doesn't occur any more.

Start rabbitmq-server fix my scenario.

In my case the problem was a container that was down

It seems like it is back for 4.6.5 downgrading it 4.6.4 fixed it for me. Using celery==4.3.0

hey guys, I know that this ticket is marked as Closed but I am at my wits end trying to solve this issue on my own. My current celery setup uses 3 machines: celery producer lives on server A, rabbitMQ server lives on B, and my celery workers on C. I am currently running into errors when my celery producers call task.delay() because it just hangs (so I will have to manually stop it from retrying). It looks like server A is having trouble connecting to server B when trying to enqueue a message and I cannot find any other online resources to help with this issue. Sorry if this is not the correct place to put this question.

I am using

  • RabbitMQ: 3.7.17
  • Celery: 4.3.0
  • Python: 3.6.7
  • OS: Ubuntu 18.04.3 LTS bionic

Here is my rabbitmq.config:

[
 {ssl, [{versions, ['tlsv1.2', 'tlsv1.1']}]},
 {rabbit,
  [
    {tcp_listeners, [{"127.0.0.1", 5672}]},
    {ssl_listeners, [5671]},
    {ssl_options, [{cacertfile, "/usr/local/share/ca-certificates/rootca.crt"},
                   {certfile, "/usr/local/share/ca-certificates/cert.crt"},
                   {keyfile, "/usr/local/share/private/key.key"},
                   {versions, ['tlsv1.2', 'tlsv1.1']},
                   {verify, verify_peer},
                   {fail_if_no_peer_cert, false}
                  ]},
    {auth_mechanisms, ['PLAIN', 'AMQPLAIN', 'EXTERNAL']}

  ]
 }
,{rabbitmq_management,
  [
   {listener, [{port, 15672},
               {ssl, true},
               {ssl_opts, [{cacertfile, "/usr/local/share/ca-certificates/rootca.crt"},
                           {certfile, "/usr/local/share/ca-certificates/cert.crt"},
                           {keyfile, "/usr/local/share/private/key.key"},
                           {versions, ['tlsv1.2', 'tlsv1.1']},
                           {verify, verify_peer},
                           {fail_if_no_peer_cert, false}]}
              ]}
  ]
 }
].

Here is the stacktrace

Traceback (most recent call last):
  File "/gtang/repo/lib/python3.6/site-packages/kombu/utils/functional.py", line 42, in __call__
    return self.__value__
AttributeError: 'ChannelPromise' object has no attribute '__value__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/gtang/repo/lib/python3.6/site-packages/amqp/transport.py", line 137, in _connect
    host, port, family, socket.SOCK_STREAM, SOL_TCP)
  File "/gtang/.pyenv/versions/3.6.7/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -9] Address family for hostname not supported

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/gtang/repo/lib/python3.6/site-packages/kombu/utils/functional.py", line 343, in retry_over_time
    return fun(*args, **kwargs)
  File "/gtang/repo/lib/python3.6/site-packages/kombu/connection.py", line 275, in connect
    return self.connection
  File "/gtang/repo/lib/python3.6/site-packages/kombu/connection.py", line 823, in connection
    self._connection = self._establish_connection()
  File "/gtang/repo/lib/python3.6/site-packages/kombu/connection.py", line 778, in _establish_connection
    conn = self.transport.establish_connection()
  File "/gtang/repo/lib/python3.6/site-packages/kombu/transport/pyamqp.py", line 130, in establish_connection
    conn.connect()
  File "/gtang/repo/lib/python3.6/site-packages/amqp/connection.py", line 307, in connect
    self.transport.connect()
  File "/gtang/repo/lib/python3.6/site-packages/amqp/transport.py", line 77, in connect
    self._connect(self.host, self.port, self.connect_timeout)
  File "/gtang/repo/lib/python3.6/site-packages/amqp/transport.py", line 148, in _connect
    "failed to resolve broker hostname"))
  File "/gtang/repo/lib/python3.6/site-packages/amqp/transport.py", line 161, in _connect
    self.sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/gtang/repo/lib/python3.6/site-packages/celery/app/task.py", line 427, in delay
    return self.apply_async(args, kwargs)
  File "/gtang/repo/lib/python3.6/site-packages/celery_once/tasks.py", line 108, in apply_async
    return super(QueueOnce, self).apply_async(args, kwargs, **options)
  File "/gtang/repo/lib/python3.6/site-packages/celery/app/task.py", line 570, in apply_async
    **options
  File "/gtang/repo/lib/python3.6/site-packages/celery/app/base.py", line 756, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "/gtang/repo/lib/python3.6/site-packages/celery/app/amqp.py", line 552, in send_task_message
    **properties
  File "/gtang/repo/lib/python3.6/site-packages/kombu/messaging.py", line 181, in publish
    exchange_name, declare,
  File "/gtang/repo/lib/python3.6/site-packages/kombu/connection.py", line 510, in _ensured
    return fun(*args, **kwargs)
  File "/gtang/repo/lib/python3.6/site-packages/kombu/messaging.py", line 187, in _publish
    channel = self.channel
  File "/gtang/repo/lib/python3.6/site-packages/kombu/messaging.py", line 209, in _get_channel
    channel = self._channel = channel()
  File "/gtang/repo/lib/python3.6/site-packages/kombu/utils/functional.py", line 44, in __call__
    value = self.__value__ = self.__contract__()
  File "/gtang/repo/lib/python3.6/site-packages/kombu/messaging.py", line 224, in <lambda>
    channel = ChannelPromise(lambda: connection.default_channel)
  File "/gtang/repo/lib/python3.6/site-packages/kombu/connection.py", line 852, in default_channel
    self.ensure_connection(**conn_opts)
  File "/gtang/repo/lib/python3.6/site-packages/kombu/connection.py", line 422, in ensure_connection
    callback, timeout=timeout)
  File "/gtang/repo/lib/python3.6/site-packages/kombu/utils/functional.py", line 357, in retry_over_time
    sleep(1.0)
KeyboardInterrupt

Please refer to StackOverflow or our mailing list.

Hey @gtangthousandeyes, I'm facing same issue. Did you happen to resolve it?

Traceback (most recent call last):
  File "/.../venv/lib/python3.8/site-packages/kombu/utils/functional.py", line 43, in __call__
    return self.__value__
AttributeError: 'ChannelPromise' object has no attribute '__value__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../venv/lib/python3.8/site-packages/amqp/transport.py", line 137, in _connect
    entries = socket.getaddrinfo(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

...

I solved it. Here's the steps that worked for me:

pip install dramatiq

For me, reinstalled rabbitmq with newer version and it worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

acknowledgeHim picture acknowledgeHim  路  6Comments

ashcrow picture ashcrow  路  5Comments

vibhavagarwal5 picture vibhavagarwal5  路  6Comments

ronnie-webb picture ronnie-webb  路  4Comments

subodh-malgonde picture subodh-malgonde  路  3Comments