Celery task throwing "OSError: [Errno 22] Invalid argument" on linode
I'm trying to run a celery chord task on Django using gevent. Midway through it's execution it starts throwing this error:
OSError: [Errno 22] Invalid argument
(<ThreadPoolWorker at 0x7f3e211b7460 thread_ident=0x7f3e211a6700 threadpool-hub=<Hub at 0x7f3e2b430580 thread_ident=0x7f3e2f331740>>, <built-in function getaddrinfo>) failed with OSError
I'm not sure what's causing this. The task runs perfectly fine if run on local machine and there doesn't seem to be any issue in the code itself. Also tried updating the ulimit to a higer value, but with no luck. Anybody know anything about this error?
1 Reply
I'm not familiar with what you're trying to do so this is just a guess…
[Errno 22] is from here (in /usr/include/errno.h):
#define EINVAL 22 /* Invalid argument */
I would look at the arguments to the built-in function getaddrinfo(). getaddrinfo(3) is a system call for doing DNS resolution programmatically. You may have to substitute 127.0.0.1 (or ::1) for your use of localhost…or add an entry for localhost in /etc/hosts.
You may also be trying to use an undefined service…or the node at the domain name you're trying to resolve doesn't support the service you want to use.
See getaddrinfo(3).
This may also help:
https://stackoverflow.com/questions/63194917/python-how-to-solve-oserror-errno-22-invalid-argument
-- sw