Replies: 10 comments
-
please post on celery-users list or IRC #celery first before you aare sure it's a celery bug. |
Beta Was this translation helpful? Give feedback.
-
@auvipy sorry about that, just posted to both, thanks for the headsup. although the IRC thing seems weird to me..just started using it, but anytime I go off my computer it logs out and there is no way to see the messages sent when offline. |
Beta Was this translation helpful? Give feedback.
-
I believe this could be a bug with celery due to the fact that the function works fine as a non celery task (aka before I put .delay()). It makes the api calls and updates the db smoothly. When I add it as a task I get ssl errors and max retries exceeded. Can't figure out why this would be. I have celery configured correctly it seems (as other simple tasks work fine like hello_world) unless there is specific settings for api call functions. |
Beta Was this translation helpful? Give feedback.
-
please come with a test case |
Beta Was this translation helpful? Give feedback.
-
Test Case:
When I make it the get request the google api (with my api key), I get the ssl error, but only when it is a task through celery. The actually url there is no problem with running a curl to get the data/when its not a task and run by itself it works fine. So it seems like there is some kind of issue with celery and the google api, I have no idea where/what it could be.
|
Beta Was this translation helpful? Give feedback.
-
btw you can test out the google api/get the url for the get request here (just unselect the api and oauth: |
Beta Was this translation helpful? Give feedback.
-
update on master? |
Beta Was this translation helpful? Give feedback.
-
were you able to figure out a resolution to this issue? |
Beta Was this translation helpful? Give feedback.
-
You might have a different Python interpreter running Celery which wasn't built with OpenSSL support. |
Beta Was this translation helpful? Give feedback.
-
am going through the same issue when i call my celery tasks with .delay |
Beta Was this translation helpful? Give feedback.
-
Could not find a dublitcate issue regarding this.
I have celery setup fine in that it works for simple tasks like a hello world (calling hello_world.delay() in django views there is no problem).
I created another more complicated function that involves making many calls to a an api to retrieve data to update the database. Just calling this function without celery (task_a()) there is no problem, and the database gets updated(takes around 15 seconds or so...that is why I want to use celery).
My settings are as follow..I am not sure if I am supposed to change anything with regards to the backend to get it working as well..I am using django default sqlite..not really sure what 'django-db' means:
WSGI_APPLICATION = 'trydjango.wsgi.application'
CELERY_BROKER_URL = 'redis://127.0.0.1:6379/0'
BROKER_TRANSPORT = 'redis'
CELERY_RESULT_BACKEND = 'django-db'
CELERY_TIMEZONE = 'Asia/Makassar'
But when I add .delay() to this to make it a celery task I get the following error. I can't figure out why there would be this disparity, any thoughts? :
INFO/MainProcess] Received task: todo.tasks.update_comments[ae9bebfe-4b3c-46ec-b197-0ffa56847f30]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/tylervanzo/Desktop/trydjango/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/Users/tylervanzo/Desktop/trydjango/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/Users/tylervanzo/Desktop/trydjango/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in validate_conn
conn.connect()
File "/Users/tylervanzo/Desktop/trydjango/lib/python3.7/site-packages/urllib3/connection.py", line 394, in connect
ssl_context=context,
File "/Users/tylervanzo/Desktop/trydjango/lib/python3.7/site-packages/urllib3/util/ssl.py", line 370, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/Users/tylervanzo/Desktop/trydjango/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket
raise ssl.SSLError("bad handshake: %r" % e)
ssl.SSLError: ("bad handshake: SysCallError(54, 'ECONNRESET')",)
Beta Was this translation helpful? Give feedback.
All reactions