I'am trying to send task from django local app too remote rabbitmq server (preprod through vpn) but when I'm trying to send it always same error occure. Two errors code are related [Errno -9] Address family for hostname not supported and [Errno 111] Connection refused. The port 5672 is open the user is not the default user and the broker url is amqp://dist:dist#amqp.nopow-link.com:5672.
If someone can help me to understand what I'm doing wrong.
From the client:
>>> task.hello_task.apply_async()
Traceback (most recent call last):
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/utils/functional.py", line 30, 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/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/amqp/transport.py", line 173, in _connect
host, port, family, socket.SOCK_STREAM, SOL_TCP)
File "/usr/lib/python3.7/socket.py", line 748, 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 "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 447, in _reraise_as_library_errors
yield
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 438, in _ensure_connection
callback, timeout=timeout
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/utils/functional.py", line 312, in retry_over_time
return fun(*args, **kwargs)
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 878, in _connection_factory
self._connection = self._establish_connection()
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 813, in _establish_connection
conn = self.transport.establish_connection()
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/transport/pyamqp.py", line 201, in establish_connection
conn.connect()
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/amqp/connection.py", line 323, in connect
self.transport.connect()
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/amqp/transport.py", line 113, in connect
self._connect(self.host, self.port, self.connect_timeout)
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/amqp/transport.py", line 184, in _connect
"failed to resolve broker hostname"))
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/amqp/transport.py", line 197, in _connect
self.sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/celery/app/task.py", line 579, in apply_async
**options
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/celery/app/base.py", line 788, in send_task
amqp.send_task_message(P, name, message, **options)
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/celery/app/amqp.py", line 519, in send_task_message
**properties
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/messaging.py", line 180, in publish
exchange_name, declare, timeout
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 524, in _ensured
return fun(*args, **kwargs)
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/messaging.py", line 186, in _publish
channel = self.channel
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/messaging.py", line 209, in _get_channel
channel = self._channel = channel()
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/utils/functional.py", line 32, in __call__
value = self.__value__ = self.__contract__()
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/messaging.py", line 225, in <lambda>
channel = ChannelPromise(lambda: connection.default_channel)
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 896, in default_channel
self._ensure_connection(**conn_opts)
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 438, in _ensure_connection
callback, timeout=timeout
File "/usr/lib/python3.7/contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "/home/callmarl/env/nopow_link/website/application/lib/python3.7/site-packages/kombu/connection.py", line 451, in _reraise_as_library_errors
raise ConnectionError(str(exc)) from exc
kombu.exceptions.OperationalError: [Errno 111] Connection refused
On the server:
user
Listing permissions for user "dist" ...
/ .* .* .*
port
tcp 0 0 0.0.0.0:5672 0.0.0.0:* LISTEN 115995/beam.smp
On server nothing append when listening with tcpdump on port 5672 and no logs are displayed too (log.file.level = debug)
Notice: If I'am sending the same task from the server it's working well.
[2022-05-04 13:24:12,678: INFO/MainProcess] Task core.task.hello_task[a34f9869-03b8-4f4b-8139-b56f90deb469] received
[2022-05-04 13:24:12,680: WARNING/ForkPoolWorker-1] You want me to say hello?
[2022-05-04 13:24:12,680: WARNING/ForkPoolWorker-1] Hello.
[2022-05-04 13:24:12,680: INFO/ForkPoolWorker-1] Task core.task.hello_task[a34f9869-03b8-4f4b-8139-b56f90deb469] succeeded in 0.0006248119752854109s: None
Related
I made a Discord Bot using Python 3.6. It runs and behaves perfectly when run on my computer, yet when I run it on PythonAnywhere, I get this message. I installed Discord.py and all necessary modules. Please help. I am not that very good with complex programming talk, and not at all good with web talk, so please answer as simply as you can. Does this issue only happen with PythonAnywhere or all remote hosting sites?
01:42 ~ $ python3.6 MyCoolBot.py
Traceback (most recent call last):
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 601, in _create_direc
t_connection
local_addr=self._local_addr)
File "/usr/lib/python3.6/asyncio/base_events.py", line 778, in create_connection
raise exceptions[0]
File "/usr/lib/python3.6/asyncio/base_events.py", line 765, in create_connection
yield from self.sock_connect(sock, address)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 450, in sock_connect
return (yield from fut)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 480, in _sock_connect_cb
raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('104.16.58.5', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 304, in connect
yield from self._create_connection(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 578, in _create_conne
ction
transport, proto = yield from self._create_direct_connection(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 624, in _create_direc
t_connection
(req.host, req.port, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 111] Can not connect to discordapp.com:443 [Connect call failed ('104.16.
58.5', 443)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "MyCoolBot.py", line 39, in <module>
client.run('MY_BOT_TOKEN')
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 519, in run
self.loop.run_until_complete(self.start(*args, **kwargs))
File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 490, in start
yield from self.login(*args, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 416, in login
yield from getattr(self, '_login_' + str(n))(*args, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 346, in _login_1
data = yield from self.http.static_login(token, bot=is_bot)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/http.py", line 258, in static_login
data = yield from self.request(Route('GET', '/users/#me'))
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/http.py", line 137, in request
r = yield from self.session.request(method, url, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/client.py", line 555, in __iter__
resp = yield from self._coro
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/client.py", line 198, in _request
conn = yield from self._connector.connect(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 314, in connect
.format(key, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 111] Cannot connect to host discordapp.com:443 ssl:True [Can not connect to discordapp.com:443 [Connect call failed ('104.16.58.5', 443)]]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f4b25d81be0>
This is because PythonAnywhere requires a proxy in such a way that the aiohttp websockets don't support. There's a thread on their forums about it here: https://www.pythonanywhere.com/forums/topic/7384/ (See #Patrick Haugh's comment above)
I made a Discord Bot using Python 3.6. It runs and behaves perfectly when run on my computer, yet when I run it on PythonAnywhere, I get this message. I installed Discord.py and all necessary modules. Please help. I am not that very good with complex programming talk, and not at all good with web talk, so please answer as simply as you can. Does this issue only happen with PythonAnywhere or all remote hosting sites?
01:42 ~ $ python3.6 MyCoolBot.py
Traceback (most recent call last):
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 601, in _create_direc
t_connection
local_addr=self._local_addr)
File "/usr/lib/python3.6/asyncio/base_events.py", line 778, in create_connection
raise exceptions[0]
File "/usr/lib/python3.6/asyncio/base_events.py", line 765, in create_connection
yield from self.sock_connect(sock, address)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 450, in sock_connect
return (yield from fut)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 480, in _sock_connect_cb
raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('104.16.58.5', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 304, in connect
yield from self._create_connection(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 578, in _create_conne
ction
transport, proto = yield from self._create_direct_connection(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 624, in _create_direc
t_connection
(req.host, req.port, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 111] Can not connect to discordapp.com:443 [Connect call failed ('104.16.
58.5', 443)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "MyCoolBot.py", line 39, in <module>
client.run('MY_BOT_TOKEN')
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 519, in run
self.loop.run_until_complete(self.start(*args, **kwargs))
File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 490, in start
yield from self.login(*args, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 416, in login
yield from getattr(self, '_login_' + str(n))(*args, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 346, in _login_1
data = yield from self.http.static_login(token, bot=is_bot)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/http.py", line 258, in static_login
data = yield from self.request(Route('GET', '/users/#me'))
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/http.py", line 137, in request
r = yield from self.session.request(method, url, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/client.py", line 555, in __iter__
resp = yield from self._coro
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/client.py", line 198, in _request
conn = yield from self._connector.connect(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 314, in connect
.format(key, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 111] Cannot connect to host discordapp.com:443 ssl:True [Can not connect to discordapp.com:443 [Connect call failed ('104.16.58.5', 443)]]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f4b25d81be0>
This is because PythonAnywhere requires a proxy in such a way that the aiohttp websockets don't support. There's a thread on their forums about it here: https://www.pythonanywhere.com/forums/topic/7384/ (See #Patrick Haugh's comment above)
I am not able to figure this out. I have flask app with celery and using Redis as a broker on Ubuntu 16.04. It was working fine for the last many days and today all of a sudden it is giving the following exception. Works fine locally on my OSX. Fails on the ubuntu virtual server.
[2017-07-26 20:12:25,512: WARNING/MainProcess] consumer: Connection to broker lost. Trying to re-establish the connection...
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 129, in _read_from_socket
raise socket.error(SERVER_CLOSED_CONNECTION_ERROR)
OSError: Connection closed by server.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 2165, in _execute
return command(*args)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 577, in read_response
response = self._parser.read_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 238, in read_response
response = self._buffer.readline()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 168, in readline
self._read_from_socket()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 143, in _read_from_socket
(e.args,))
redis.exceptions.ConnectionError: Error while reading from socket: ('Connection closed by server.',)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
sock = self._connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 494, in _connect
raise err
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 482, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/celery/worker/consumer/consumer.py", line 318, in start
blueprint.start(self)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/celery/worker/consumer/consumer.py", line 594, in start
c.loop(*c.loop_args())
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/celery/worker/loops.py", line 88, in asynloop
next(loop)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/kombu/async/hub.py", line 345, in create_loop
cb(*cbargs)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/kombu/transport/redis.py", line 1039, in on_readable
self.cycle.on_readable(fileno)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/kombu/transport/redis.py", line 337, in on_readable
chan.handlers[type]()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/kombu/transport/redis.py", line 667, in _receive
ret.append(self._receive_one(c))
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/kombu/transport/redis.py", line 678, in _receive_one
response = c.parse_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 2183, in parse_response
return self._execute(connection, connection.read_response)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 2172, in _execute
connection.connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
[2017-07-26 20:12:25,804: ERROR/MainProcess] consumer: Cannot connect to redis://localhost:6379//: Error 111 connecting to localhost:6379. Connection refused..
Trying again in 2.00 seconds...
[2017-07-26 20:12:26,725: ERROR/PoolWorker-3] Something went wrong in async processes.
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/tasks.py", line 66, in send_event_notification_async
sleep(nextEventDelayInSeconds)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/billiard/common.py", line 125, in _shutdown_cleanup
sys.exit(-(256 - signum))
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/billiard/pool.py", line 281, in exit
return _exit()
SystemExit
[2017-07-26 20:12:26,726: ERROR/PoolWorker-4] Something went wrong in async processes.
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/tasks.py", line 66, in send_event_notification_async
sleep(nextEventDelayInSeconds)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/billiard/common.py", line 125, in _shutdown_cleanup
sys.exit(-(256 - signum))
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/billiard/pool.py", line 281, in exit
return _exit()
SystemExit
[2017-07-26 20:12:26,734: ERROR/PoolWorker-8] Something went wrong in async processes.
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/tasks.py", line 66, in send_event_notification_async
sleep(nextEventDelayInSeconds)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/billiard/common.py", line 125, in _shutdown_cleanup
sys.exit(-(256 - signum))
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/billiard/pool.py", line 281, in exit
return _exit()
SystemExit
[2017-07-26 20:12:27,729: ERROR/MainProcess] Process 'PoolWorker-6' pid:2057 exited with 'signal 15 (SIGTERM)'
[2017-07-26 20:12:27,740: ERROR/MainProcess] Process 'PoolWorker-5' pid:2055 exited with 'exitcode 15'
[2017-07-26 20:12:27,750: ERROR/MainProcess] Process 'PoolWorker-2' pid:2052 exited with 'exitcode 15'
[2017-07-26 20:12:27,761: ERROR/MainProcess] Process 'PoolWorker-1' pid:2051 exited with 'exitcode 15'
[2017-07-26 20:12:27,812: ERROR/MainProcess] Process 'PoolWorker-7' pid:2059 exited with 'exitcode 15'
[2017-07-26 20:13:27,799: ERROR/PoolWorker-3] Something went wrong in async processes.
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 129, in _read_from_socket
raise socket.error(SERVER_CLOSED_CONNECTION_ERROR)
OSError: Connection closed by server.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 573, in execute_command
return self.parse_response(connection, command_name, **options)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 585, in parse_response
response = connection.read_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 577, in read_response
response = self._parser.read_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 238, in read_response
response = self._buffer.readline()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 168, in readline
self._read_from_socket()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 143, in _read_from_socket
(e.args,))
redis.exceptions.ConnectionError: Error while reading from socket: ('Connection closed by server.',)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
sock = self._connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 494, in _connect
raise err
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 482, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/tasks.py", line 45, in send_event_notification_async
r.set(priority, True)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 1072, in set
return self.execute_command('SET', *pieces)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 578, in execute_command
connection.send_command(*args)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 563, in send_command
self.send_packed_command(self.pack_command(*args))
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 538, in send_packed_command
self.connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
[2017-07-26 20:13:27,800: ERROR/PoolWorker-4] Something went wrong in async processes.
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 129, in _read_from_socket
raise socket.error(SERVER_CLOSED_CONNECTION_ERROR)
OSError: Connection closed by server.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 573, in execute_command
return self.parse_response(connection, command_name, **options)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 585, in parse_response
response = connection.read_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 577, in read_response
response = self._parser.read_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 238, in read_response
response = self._buffer.readline()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 168, in readline
self._read_from_socket()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 143, in _read_from_socket
(e.args,))
redis.exceptions.ConnectionError: Error while reading from socket: ('Connection closed by server.',)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
sock = self._connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 494, in _connect
raise err
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 482, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/tasks.py", line 45, in send_event_notification_async
r.set(priority, True)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 1072, in set
return self.execute_command('SET', *pieces)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 578, in execute_command
connection.send_command(*args)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 563, in send_command
self.send_packed_command(self.pack_command(*args))
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 538, in send_packed_command
self.connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
[2017-07-26 20:13:27,802: ERROR/PoolWorker-8] Something went wrong in async processes.
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 129, in _read_from_socket
raise socket.error(SERVER_CLOSED_CONNECTION_ERROR)
OSError: Connection closed by server.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 573, in execute_command
return self.parse_response(connection, command_name, **options)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 585, in parse_response
response = connection.read_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 577, in read_response
response = self._parser.read_response()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 238, in read_response
response = self._buffer.readline()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 168, in readline
self._read_from_socket()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 143, in _read_from_socket
(e.args,))
redis.exceptions.ConnectionError: Error while reading from socket: ('Connection closed by server.',)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
sock = self._connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 494, in _connect
raise err
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 482, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dsangvikar/apps/msbot/tasks.py", line 45, in send_event_notification_async
r.set(priority, True)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 1072, in set
return self.execute_command('SET', *pieces)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/client.py", line 578, in execute_command
connection.send_command(*args)
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 563, in send_command
self.send_packed_command(self.pack_command(*args))
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 538, in send_packed_command
self.connect()
File "/home/dsangvikar/apps/msbot/msbotenv/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
I guess it retries after 2 seconds and again fails and the same exceptions. What is more confusing is redis-server is up and running properly. redis-cli ping works. Further more, I opened up redis-cli and tried to get the values which the celery worker is supposed to add. Those are also gettable. Btw, I flush all the values on server restart. So when I restarted the server, it updated the values accordingly. How do I figure out what's wrong?
I didn't make any changes on the redis-server configuration files. All ways working well till yesterday.
edit: What is suprising is that I get this error 'ConnectionRefusedError: [Errno 111] Connection refused' after some of the statements have been executed. So basically it connects to the redis db, puts in the values and then fails. What?
celery workers stops working.
How to catch this error?
Connection timeout can happen due to any other reason also.
amqp==2.1.4
billiard==3.5.0.2
celery==4.0.2
docopt==0.4.0
kombu==4.0.2
pkg-resources==0.0.0
simplejson==3.10.0
vine==1.1.3
[2017-06-27 05:56:28,862: ERROR/MainProcess] Control command error: error(104, 'Connection reset by peer')
Traceback (most recent call last):
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages /celery/worker/pidbox.py", line 42, in on_message
self.node.handle_message(body, message)
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/kombu/pidbox.py", line 129, in handle_message
return self.dispatch(**body)
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/kombu/pidbox.py", line 112, in dispatch
ticket=ticket)
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/kombu/pidbox.py", line 135, in reply
serializer=self.mailbox.serializer)
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/kombu/pidbox.py", line 265, in _publish_reply
**opts
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/kombu/messaging.py", line 181, in publish
exchange_name, declare,
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/kombu/messaging.py", line 203, in _publish
mandatory=mandatory, immediate=immediate,
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/amqp/channel.py", line 1748, in _basic_publish
(0, exchange, routing_key, mandatory, immediate), msg
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/amqp/abstract_channel.py", line 64, in send_method
conn.frame_writer(1, self.channel_id, sig, args, content)
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/amqp/method_framing.py", line 174, in write_frame
write(view[:offset])
File "/home/usher/virt/delivery/local/lib/python2.7/site-packages/amqp/transport.py", line 263, in write
self._write(s)
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
error: [Errno 104] Connection reset by peer
I'm trying to write code to view messages from my g-mail, then search in the latest message for a certain phrase, that triggers a command.
But I'm having problems with connecting to my g-mail
from imapclient import IMAPClient
HOST = 'imap.gmail.com'
USERNAME = 'email'
PASSWORD = 'password'
ssl = False
server = IMAPClient(HOST, use_uid=True, ssl=ssl)
server.login(USERNAME, PASSWORD)
server.select_folder('INBOX')
print ('success')
I just added the 'success' at the end to make sure it worked, I'm using imap here but I tried pop which seems to be more confusing.
When I run this code i get this.
Traceback (most recent call last):
File "C:/Users/Yousef/Desktop/parser.py", line 8, in <module>
server = IMAPClient(HOST, use_uid=True, ssl=ssl)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\imapclient.py", line 152, in __init__
self._imap = self._create_IMAP4()
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\imapclient.py", line 166, in _create_IMAP4
return imap4.IMAP4WithTimeout(self.host, self.port, self._timeout)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\imap4.py", line 13, in __init__
imaplib.IMAP4.__init__(self, address, port)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-
32\lib\imaplib.py", line 197, in __init__
self.open(host, port)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-
32\lib\imaplib.py", line 294, in open
self.sock = self._create_socket()
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\imap4.py", line 16, in _create_socket
return socket.create_connection((self.host, self.port), self._timeout)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-
32\lib\socket.py", line 722, in create_connection
raise err
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-
32\lib\socket.py", line 713, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond
Someone please help me with this, because this is my first time using imap/pop.
when I put ssl to true, I get this...
Traceback (most recent call last):
File "C:\Users\Yousef\Desktop\parser.py", line 8, in <module>
server = IMAPClient(HOST, use_uid=True, ssl=ssl)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\imapclient.py", line 152, in __init__
self._imap = self._create_IMAP4()
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\imapclient.py", line 164, in _create_IMAP4
self._timeout)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\tls.py", line 171, in __init__
imaplib.IMAP4.__init__(self, host, port)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-
32\lib\imaplib.py", line 197, in __init__
self.open(host, port)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\tls.py", line 177, in open
self.sock = wrap_socket(sock, self.ssl_context, host)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\tls.py", line 144, in wrap_socket
ssl_context = create_default_context()
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\imapclient\tls.py", line 127, in create_default_context
context.load_verify_locations(cadata=certs)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\backports\ssl\core.py", line 654, in load_verify_locations
self._ctx.load_verify_locations(cafile, capath)
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\OpenSSL\SSL.py", line 669, in load_verify_locations
_raise_current_error()
File "C:\Users\Yousef\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\OpenSSL\_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)
OpenSSL.SSL.Error: []
nvm i found a solution, thanks for the help anyways.