社区版13.0 无法使用密码验证的Redis作为缓存服务器

发现13.0支持了Redis,遂试用之,得到如下错误:

[seafevents] [2025-07-27 10:32:26] [CRITICAL] seafevents.app.event_redis:62 connect to redis auth error: AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
Exception in thread Thread-15:
Traceback (most recent call last):
[seafevents] [2025-07-27 10:32:26] [WARNING] root:87 Can not start seasearch wiki index updater: it is not enabled!
[seafevents] [2025-07-27 10:32:26] [WARNING] root:112 Can not start wiki index updater: it is not enabled!
  File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
[seafevents] [2025-07-27 10:32:26] [INFO] root:213 Starting quota usage saver timer, interval = 30 sec
[seafevents] [2025-07-27 10:32:26] [INFO] root:217 Starting repo change collector
    self.run()
  File "/opt/seafile/seafile-server-13.0.7/pro/python/seafevents/events/metrics.py", line 51, in run
    subscriber = self._redis_client.get_subscriber(METRIC_CHANNEL_NAME)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/seafile/seafile-server-13.0.7/pro/python/seafevents/app/event_redis.py", line 63, in get_subscriber
    raise e
  File "/opt/seafile/seafile-server-13.0.7/pro/python/seafevents/app/event_redis.py", line 60, in get_subscriber
    subscriber.subscribe(channel_name)
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/client.py", line 932, in subscribe
    ret_val = self.execute_command("SUBSCRIBE", *new_channels.keys())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/client.py", line 761, in execute_command
[seafevents] [2025-07-27 10:32:26] [ERROR] seafevents.mq:17 Redis server can't be connected: host 172.17.0.1, port 6379, error AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
    self.connection = self.connection_pool.get_connection(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/connection.py", line 289, in connect
    self.on_connect()
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/connection.py", line 354, in on_connect
    auth_response = self.read_response()
                    ^^^^^^^^^^^^^^^^^^^^
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/connection.py", line 512, in read_response
    response = self._parser.read_response(disable_decoding=disable_decoding)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/_parsers/resp2.py", line 15, in read_response
[seafevents] [2025-07-27 10:32:26] [INFO] root:162 Starting handle redis channel
[seafevents] [2025-07-27 10:32:26] [INFO] root:22 seahub quota alert email sender is started, interval = 86400 sec
    result = self._read_response(disable_decoding=disable_decoding)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/seafile/seafile-server-13.0.7/seahub/thirdpart/redis/_parsers/resp2.py", line 38, in _read_response
    raise error
redis.exceptions.AuthenticationError: AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
[seafevents] [2025-07-27 10:32:26] [ERROR] root:177 Failed to collect repo change information: AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
[seafevents] [2025-07-27 10:32:26] [INFO] root:491 Monthly traffic counter finished, update 0 user items, 0 org items, total time: 0.09802031517028809 seconds.
[seafevents] [2025-07-27 10:32:26] [INFO] root:169 [FileOpsCounter] Finish counting file operations in 0.09812474250793457 seconds, 0 added, 0 deleted, 0 visited, 0 modified
[seafevents] [2025-07-27 10:32:26] [INFO] root:225 [TotalStorageCounter] Finish counting total storage in 0.10384941101074219 seconds.
[seafevents] [2025-07-27 10:32:26] [ERROR] root:177 Failed to collect repo change information: AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?

相关Redis的配置如下:

CACHE_PROVIDER=redis
REDIS_HOST=172.17.0.1
REDIS_PORT=6379
REDIS_PASSWORD="REDIS_PASSWORD_HERE"
MEMCACHED_HOST=172.17.0.1
MEMCACHED_PORT=11211

但修改成 CACHE_PROVIDER=memcached 就可以启动。说明REDIS_PASSWORD字段并未被Seafile读取。

UPDATE:

Redis 6.0+ 使用了ACL,但是目前的配置文件只能用旧的requirepass。

所以 Seafile 什么时候可以支持Redis ACL呢?

暂时还没升级,纯讨论。

13的seafile-server.yml里面我刚看了一下,是有REDIS密码读取配置的呀。

redis:
image: ${SEAFILE_REDIS_IMAGE:-redis}
container_name: seafile-redis
restart: unless-stopped
command:

  • /bin/sh
  • -c
  • redis-server --requirepass “$$REDIS_PASSWORD”
    environment:
  • REDIS_PASSWORD=${REDIS_PASSWORD:-}
    networks:
  • seafile-net