question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Kombo + SQS + PyCurl, 'NoneType' object has no attribute 'call_repeatedly'

See original GitHub issue

Hi. I’m running the lastest Kombu master (w/ stable 4.0.2 Celery), SQS Broker, with Django DB Backend, and I run into this error.

[2017-05-31 08:08:47,205: ERROR/MainProcess] Pending callback raised: AttributeError("'NoneType' object has no attribute 'call_repeatedly'",)
Traceback (most recent call last):
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/celery/worker/consumer/consumer.py", line 233, in perform_pending_operations
    self._pending_operations.pop()()
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/vine/promises.py", line 139, in __call__
    return self.throw()
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/vine/promises.py", line 136, in __call__
    retval = fun(*final_args, **final_kwargs)
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/message.py", line 130, in ack_log_error
    self.ack(multiple=multiple)
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/message.py", line 125, in ack
    self.channel.basic_ack(self.delivery_tag, multiple=multiple)
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/transport/SQS.py", line 380, in basic_ack
    self.asynsqs.delete_message(message['sqs_queue'],
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/transport/SQS.py", line 436, in asynsqs
    region=self.region
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/async/aws/sqs/connection.py", line 27, in __init__
    **kwargs
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/async/aws/connection.py", line 178, in __init__
    **http_client_params)
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/async/aws/connection.py", line 151, in __init__
    self._httpclient = http_client or get_client()
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/async/http/__init__.py", line 22, in get_client
    client = hub._current_http_client = Client(hub, **kwargs)
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/async/http/__init__.py", line 13, in Client
    return CurlClient(hub, **kwargs)
  File "/home/ubuntu/ies-league/venv/local/lib/python2.7/site-packages/kombu/async/http/curl.py", line 57, in __init__
    self._timeout_check_tref = self.hub.call_repeatedly(
AttributeError: 'NoneType' object has no attribute 'call_repeatedly'
[2017-05-31 08:08:47,207: ERROR/MainProcess] Pending callback raised: AttributeError("'NoneType' object has no attribute 'call_repeatedly'",)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
alukachcommented, Jun 21, 2017

Okay, digging through the Kombu source code, it appears I needed to add the following near the top of my Consumer file:

from kombu.async import Hub, set_event_loop

set_event_loop(Hub())

This will ensure that a Hub object is returned when get_event_loop() is called in kombu/async/http/__init__.py:

def get_client(hub=None, **kwargs):
    """Get or create HTTP client bound to the current event loop."""
    hub = hub or get_event_loop()
    try:
        return hub._current_http_client
    except AttributeError:
        client = hub._current_http_client = Client(hub, **kwargs)
        return client

What would be the harm in having get_event_loop() call set_event_loop(Hub()) if no event loop currently exists? I’d be happy to make a PR for this.

5reactions
nsonic001commented, Jul 18, 2018

Is this issue resolved, or which version is stable? I am experiencing the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Celery + SQS - pycurl error - Stack Overflow
Looks like it could be an issue with the version of Celery (4.1.0) that you have. If I execute the same code after...
Read more >
Elastic Beanstalk with Celery and SQS : r/django - Reddit
I got some error when I was deploying my app to EB. The error was "ImportError: The curl client requires the pycurl library."....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found