Platypush: Error 111 connecting to localhost:6379. Connection refused #232

Closed
opened 2022-11-23 02:03:12 +01:00 by Athos117 · 4 comments

Description
When trying to run Platypush with the RSS plugin for a Mastodon bot, console spams "Error 111 connecting to localhost:6379. Connection refused" and its traceback, and prevents it from running.

Log of the error

2022-11-22 21:45:43,213| INFO|platypush:plugin=rss|Initialized RSS plugin with 1 subscriptions
2022-11-22 21:45:43,669|ERROR|platypush:plugin=rss|Error 111 connecting to localhost:6379. Connection refused. 
Traceback (most recent call last):
 File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 611, in connect 
  sock = self.retry.call_with_retry(
 File "/usr/local/lib/python3.10/dist-packages/redis/retry.py", line 46, in call_with_retry 
  return do()
 File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 612, in <lambda> 
  lambda: self._connect(), lambda error: self.disconnect(error)
 File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 677, in _connect 
  raise err
 File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 665, 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 "/usr/local/lib/python3.10/dist-packages/platypush/plugins/__init__.py", line 112, in _runner 
  self.main()
 File "/usr/local/lib/python3.10/dist-packages/platypush/plugins/rss/__init__.py", line 374, in main 
  get_bus().post(NewFeedEntryEvent(**entry))
 File "/usr/local/lib/python3.10/dist-packages/platypush/bus/redis.py", line 46, in post
  return self.redis.rpush(self.redis_queue, str(msg))
 File "/usr/local/lib/python3.10/dist-packages/redis/commands/core.py", line 2695, in rpush
  return self.execute_command("RPUSH", name, *values)
 File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 1235, in execute_command
  conn = self. connection or pool.get_connection(command_name, **options)
 File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 1387, in get_connection
  connection.connect()
 File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 617, in connect
  raise ConnectionErrox(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.

To reproduce
I followed the exact same steps detailed in this article.

  1. Install Platypush with the RSS integration.
[sudo] pip3 install 'platypush[rss]'
  1. Create the required config.yaml file as detailed in the article.
  2. Create the .py script as detailed in the article.
  3. Run platypush.

Device used
OS: Canonical-Ubuntu-22.04-aarch64-2022.11.06-0
Shape: VM.Standard.A1.Flex
Memory: 8GB

**Description** When trying to run Platypush with the RSS plugin for a Mastodon bot, console spams "Error 111 connecting to localhost:6379. Connection refused" and its traceback, and prevents it from running. **Log of the error** ``` 2022-11-22 21:45:43,213| INFO|platypush:plugin=rss|Initialized RSS plugin with 1 subscriptions 2022-11-22 21:45:43,669|ERROR|platypush:plugin=rss|Error 111 connecting to localhost:6379. Connection refused. Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 611, in connect sock = self.retry.call_with_retry( File "/usr/local/lib/python3.10/dist-packages/redis/retry.py", line 46, in call_with_retry return do() File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 612, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 677, in _connect raise err File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 665, 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 "/usr/local/lib/python3.10/dist-packages/platypush/plugins/__init__.py", line 112, in _runner self.main() File "/usr/local/lib/python3.10/dist-packages/platypush/plugins/rss/__init__.py", line 374, in main get_bus().post(NewFeedEntryEvent(**entry)) File "/usr/local/lib/python3.10/dist-packages/platypush/bus/redis.py", line 46, in post return self.redis.rpush(self.redis_queue, str(msg)) File "/usr/local/lib/python3.10/dist-packages/redis/commands/core.py", line 2695, in rpush return self.execute_command("RPUSH", name, *values) File "/usr/local/lib/python3.10/dist-packages/redis/client.py", line 1235, in execute_command conn = self. connection or pool.get_connection(command_name, **options) File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 1387, in get_connection connection.connect() File "/usr/local/lib/python3.10/dist-packages/redis/connection.py", line 617, in connect raise ConnectionErrox(self._error_message(e)) redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused. ``` **To reproduce** I followed the exact same steps detailed in [this article](https://blog.platypush.tech/article/Create-a-Mastodon-bot-to-forward-Twitter-and-RSS-feeds-to-your-timeline). 1. Install Platypush with the RSS integration. ``` [sudo] pip3 install 'platypush[rss]' ``` 2. Create the required config.yaml file as detailed in the article. 3. Create the .py script as detailed in the article. 4. Run ```platypush```. **Device used** OS: Canonical-Ubuntu-22.04-aarch64-2022.11.06-0 Shape: VM.Standard.A1.Flex Memory: 8GB
Owner

As mentioned in the README, Platypush requires a Redis server to dispatch messages across its components. If Redis is not running then Platypush can't work.

As mentioned [in the README](https://git.platypush.tech/platypush/platypush#user-content-installation), Platypush requires a Redis server to dispatch messages across its components. If Redis is not running then Platypush can't work.
Author

I installed redis as shown in the README, but failed to enable it. When running [sudo] systemctl enable redis terminal shows: Failed to enable unit: Refusing to operate on alias name or linked unit file: redis.service.

I also failed to find a solution in Redis' Issues, and the only close one I found was this issue at Icinga, which didn't work (changing icingadb-redis-server to redis-server and redis.service).

I installed redis as shown in the README, but failed to enable it. When running `[sudo] systemctl enable redis` terminal shows: `Failed to enable unit: Refusing to operate on alias name or linked unit file: redis.service`. I also failed to find a solution in [Redis' Issues](https://github.com/redis/redis/issues?q=Failed+to+enable+unit%3A+Refusing+to+operate+on+alias+name+or+linked+unit+file), and the only close one I found was [this issue](https://community.icinga.com/t/cannot-enable-icingadb-redis/9106/2) at Icinga, which didn't work (changing `icingadb-redis-server` to `redis-server` and `redis.service`).
Author

Found this issue also at Icinga, but it's still open.

Found [this issue](https://github.com/Icinga/icinga2/issues/9511) also at Icinga, but it's still open.
Author

Tried to run platypush again, apparently not running [sudo] systemctl enable redis nor
[sudo] systemctl start redis beforehand doesn't prevent Platypush from starting. Issue appears solved. I will close it now. Thank you @blacklight !

Tried to run `platypush` again, apparently not running `[sudo] systemctl enable redis` nor `[sudo] systemctl start redis` beforehand doesn't prevent Platypush from starting. Issue appears solved. I will close it now. Thank you @blacklight !
Athos117 changed title from RSS Plugin: Error 111 connecting to localhost:6379. Connection refused to Platypush: Error 111 connecting to localhost:6379. Connection refused 2022-11-23 03:16:56 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: platypush/platypush#232
No description provided.