- 直接访问 postgres 的 Docker 内网 IP 也失败:
172.x.x.x:5432 no response
AFFiNE 报错信息主要是:
Error: P1001: Can't reach database server at `postgres:5432`
我又做了一个最小测试,不使用 AFFiNE,只用 pgvector/pgvector:pg16 启动一个 test_pg 数据库容器,再用另一个同网络容器访问 test_pg:5432,结果同样 no response。
iptables 检查结果:
DOCKER-USER 链中有:
-A DOCKER-USER -j UG_FORWARD
UG_FORWARD 链中有:
-A UG_FORWARD -i lo -j ACCEPT
-A UG_FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A UG_FORWARD -s 192.168.x.x/16 -j RETURN
-A UG_FORWARD -j DROP
我的理解是:Docker 容器网络是 172.x.x.x,不属于 192.168.x.x/16,因此容器之间的 TCP 转发可能被 UG_FORWARD 最后的 DROP 拦截。