Skip to content

[Bug] AFFiNE 0.27.4 Cannot Start with Remote Database/Redis Due to Redis Hostname, Password, and Migration Restart Issues #13873

Description

@wingsky-1

Contact Information

Forum / GitHub: wingsky-1

1Panel Version

v2.3.1(用户确认,Web 控制台右下角为准)

Problem Description

affine:0.27.4 在“PostgreSQL + Redis 均为远端(192.168.31.165)且 Redis 需密码”条件下无法完成安装:affine_migration 因 Redis 地址不可解析而失败/空转,主服务因 depends_on: service_completed_successfully 永久 Created

安装方式:1Panel 先添加远程数据库,再在界面创建应用。原 issue 提在 appstore 仓(#9596),按维护者指引(appstore#2763 置顶通知:应用商店需求统一归主仓)转提至此。

三个子缺陷:

  1. 远端 Redis 绑定存了本机解析不了的短服务名:.env 落盘 PANEL_REDIS_HOST='affine_redis',而 PANEL_DB_HOST='192.168.31.165'(PG 存的是 IP,是对的)。容器内刷屏 getaddrinfo ENOTFOUND affine_redis,本机 nslookup → NXDOMAIN
  2. Redis 密码在界面填不进去:模板 data.ymlPANEL_REDIS_ROOT_PASSWORD disabled: true,落盘只能是空;实测远端 PING → -NOAUTH Authentication required.
  3. 一次性 affine_migration 被注入 restart: always:上游模板无 restart 字段,落盘多了 restart: always;migration 即使成功(Done in 4.25s, exit 0)也被拉起 Restarting (0),主服务永远等不到 completed。失败时则是 Restarting (1) 无限 CrashLoop。

Steps to Reproduce

  1. 在 1Panel 添加位于 192.168.31.165 的远端 PostgreSQL + Redis(Redis 设 requirepass);
  2. 应用商店安装 affine:0.27.4,数据库/Redis 选择远端服务;
  3. docker ps -a 观察(affine=Created,migration_job=Restarting),docker logs -f 1Panel-affine-xxx_migration_job 观察。

The expected correct result

  • 远端 Redis 同 PG 一样存远端地址,且密码字段可用;在仅使用远端 PG + 远端需密码 Redis 的条件下,通过界面安装一次成功;
  • affine_migration 显式 restart: "no"(或引擎不对带 service_completed_successfully 依赖的 one-shot job 注入 always);
  • migration 跑完变 Exited (0) 不再重启,主服务变 Up 并监听 3010,全程无需手工改落盘 compose/.env。

Related log output

容器状态:

1Panel-affine-i6HK                Created
1Panel-affine-i6HK_migration_job  Restarting (0)

migration 日志(PG 已通,卡在 Redis):

[Nest] ERROR [QueueRedis/SessionRedis/CacheRedis/SocketIoRedis] Error: getaddrinfo ENOTFOUND affine_redis
  errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'affine_redis'
[RunCommand] Done 1 migrations / Done in 4.25s.

本机验证:

docker run --rm --network 1panel-network busybox nslookup affine_redis
# ** server can't find affine_redis: NXDOMAIN

diff -u /opt/1panel/resource/apps/remote/affine/0.27.4/docker-compose.yml /opt/1panel/apps/affine/affine/docker-compose.yml
# +        restart: always   # affine_migration,上游无此字段

远端 Redis 需密码(.env 为空必拒):

PING -> -NOAUTH Authentication required.

Additional Information

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions