FlaskBB
A lightweight forum software in Flask
Member
Joined:
Posts: 2

Hi all,

I installed flaskbb but redis cannot be set for the hosting company (pythonanywhere) but that's ok, so I disabled it in the .cfg.

REDIS_ENABLED = False

REDIS_URL = ""
REDIS_DATABASE = 0


# Celery
# ------------------------------
CELERY_BROKER_URL = ""
CELERY_RESULT_BACKEND = ""

However, I have the following error while trying to register:

2020-06-15 17:42:42,465: Connection to Redis lost: Retry (0/20) now.
2020-06-15 17:42:42,465: Connection to Redis lost: Retry (1/20) in 1.00 second.
2020-06-15 17:42:43,467: Connection to Redis lost: Retry (2/20) in 1.00 second.
2020-06-15 17:42:44,469: Connection to Redis lost: Retry (3/20) in 1.00 second.
2020-06-15 17:42:45,470: Connection to Redis lost: Retry (4/20) in 1.00 second.
2020-06-15 17:42:46,471: Connection to Redis lost: Retry (5/20) in 1.00 second.
2020-06-15 17:42:47,473: Connection to Redis lost: Retry (6/20) in 1.00 second.
2020-06-15 17:42:48,474: Connection to Redis lost: Retry (7/20) in 1.00 second.
2020-06-15 17:42:49,475: Connection to Redis lost: Retry (8/20) in 1.00 second.
2020-06-15 17:42:50,477: Connection to Redis lost: Retry (9/20) in 1.00 second.
2020-06-15 17:42:51,478: Connection to Redis lost: Retry (10/20) in 1.00 second.
2020-06-15 17:42:52,479: Connection to Redis lost: Retry (11/20) in 1.00 second.
2020-06-15 17:42:53,481: Connection to Redis lost: Retry (12/20) in 1.00 second.
2020-06-15 17:42:54,482: Connection to Redis lost: Retry (13/20) in 1.00 second.
2020-06-15 17:42:55,482: Connection to Redis lost: Retry (14/20) in 1.00 second.
2020-06-15 17:42:56,487: Connection to Redis lost: Retry (15/20) in 1.00 second.
2020-06-15 17:42:57,489: Connection to Redis lost: Retry (16/20) in 1.00 second.
2020-06-15 17:42:58,490: Connection to Redis lost: Retry (17/20) in 1.00 second.
2020-06-15 17:42:59,492: Connection to Redis lost: Retry (18/20) in 1.00 second.
2020-06-15 17:43:00,494: Connection to Redis lost: Retry (19/20) in 1.00 second.
2020-06-15 17:43:01,495: 
Retry limit exceeded while trying to reconnect to the Celery redis result store backend. The Celery application must be restarted.
**NO MATCH**
2020-06-15 17:43:01,552: Exception on /auth/register [POST]
Traceback (most recent call last):
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 559, in connect
    sock = self._connect()
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 615, in _connect
    raise err
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 603, in _connect
    sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused
**NO MATCH**
During handling of the above exception, another exception occurred:
**NO MATCH**
Traceback (most recent call last):
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/celery/backends/redis.py", line 127, in reconnect_on_error
    yield
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/celery/backends/redis.py", line 177, in _consume_from
    self._pubsub.subscribe(key)
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/client.py", line 3580, in subscribe
    ret_val = self.execute_command('SUBSCRIBE', *iterkeys(new_channels))
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/client.py", line 3468, in execute_command
    self.shard_hint
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 1192, in get_connection
    connection.connect()
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 563, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.
**NO MATCH**
During handling of the above exception, another exception occurred:
**NO MATCH**
Traceback (most recent call last):
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 559, in connect
    sock = self._connect()
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 615, in _connect
    raise err
  File "/home/wfs/.virtualenvs/wfs_venv/lib/python3.6/site-packages/redis/connection.py", line 603, in _connect
    sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused

Is it somehow using default config properties? I do call the app with the correct cfg.

from flaskbb import create_app
flaskbb = create_app("/path/to/myconfig.cfg")

(By the way, I call flaskbb alongside my main app, which is my main website in which I want to include a forum.
I use:

app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {"/forum": flaskbb})

Is it the right way to do it?)

Thanks for your help!

Best,

Member
Joined:
Posts: 2

OK, the code does seem to look for the correct .cfg (is the name/path is not correct it returns an error) but ignores what is inside.

I ended up calling flaskbb this way:

from flaskbb import create_app as create_flaskbb
from flaskbb.configs.default import DefaultConfig as Config

Config.REDIS_ENABLED = True
flaskbb = create_flaskbb(Config)

app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {"/forum": flaskbb})

It does work better, no error most of the time.

But still, sometimes (rarely but still) I got the same error as before, when, for some reason, it decided to use Redis after all...