Skip to content

[Bug] openwrt安装后safeline-luigi和safeline-mgt提示连接不上safeline-pg #1249

@WeiFLSC

Description

@WeiFLSC

What happened?

openwrt 18安装雷池9.2.8报错
safeline-luigi和safeline-mgt容器一直重启 并且log报错连接不上safeline-pg
并且localtime也存在问题 下面是我修改了引用本地localtime后的compose文件

How we reproduce?

networks:
safeline-ce:
name: safeline-ce
driver: bridge
ipam:
driver: default
config:
- gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1
subnet: ${SUBNET_PREFIX}.0/24
driver_opts:
com.docker.network.bridge.name: safeline-ce

services:
postgres:
container_name: safeline-pg
restart: always
image: ${IMAGE_PREFIX}/safeline-postgres${ARCH_SUFFIX}:15.2
volumes:
- ${SAFELINE_DIR}/resources/postgres/data:/var/lib/postgresql/data
environment:
- TZ=Asia/Shanghai
- POSTGRES_USER=safeline-ce
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?postgres password required}
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.2
command: [postgres, -c, max_connections=600]
healthcheck:
test: pg_isready -U safeline-ce -d safeline-ce
mgt:
container_name: safeline-mgt
restart: always
image: ${IMAGE_PREFIX}/safeline-mgt${REGION}${ARCH_SUFFIX}:${IMAGE_TAG:?image tag required}
volumes:
- ${SAFELINE_DIR}/resources/mgt:/app/data
- ${SAFELINE_DIR}/logs/nginx:/app/log/nginx:z
- ${SAFELINE_DIR}/resources/sock:/app/sock
- /var/run:/app/run
ports:
- ${MGT_PORT:-9443}:1443
healthcheck:
test: curl -k -f https://localhost:1443/api/open/health
environment:
- TZ=Asia/Shanghai
- MGT_PG=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-pg/safeline-ce?sslmode=disable
- MGT_PROXY=${MGT_PROXY}
depends_on:
- postgres
- fvm
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.4
detect:
container_name: safeline-detector
restart: always
image: ${IMAGE_PREFIX}/safeline-detector${REGION}${ARCH_SUFFIX}:${IMAGE_TAG}
volumes:
- ${SAFELINE_DIR}/resources/detector:/resources/detector
- ${SAFELINE_DIR}/logs/detector:/logs/detector
environment:
- TZ=Asia/Shanghai
- LOG_DIR=/logs/detector
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.5
tengine:
container_name: safeline-tengine
restart: always
image: ${IMAGE_PREFIX}/safeline-tengine${REGION}${ARCH_SUFFIX}:${IMAGE_TAG}
volumes:
- /etc/resolv.conf:/etc/resolv.conf:ro
- ${SAFELINE_DIR}/resources/nginx:/etc/nginx
- ${SAFELINE_DIR}/resources/detector:/resources/detector
- ${SAFELINE_DIR}/resources/chaos:/resources/chaos
- ${SAFELINE_DIR}/logs/nginx:/var/log/nginx:z
- ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache
- ${SAFELINE_DIR}/resources/sock:/app/sock
environment:
- TZ=Asia/Shanghai
- TCD_MGT_API=https://${SUBNET_PREFIX}.4:1443/api/open/publish/server
- TCD_SNSERVER=${SUBNET_PREFIX}.5:8000
- SNSERVER_ADDR=${SUBNET_PREFIX}.5:8000
- CHAOS_ADDR=${SUBNET_PREFIX}.10
ulimits:
nofile: 131072
ports:
- "80:80"
- "443:443"
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.6
luigi:
container_name: safeline-luigi
restart: always
image: ${IMAGE_PREFIX}/safeline-luigi${REGION}${ARCH_SUFFIX}:${IMAGE_TAG}
environment:
- TZ=Asia/Shanghai
- MGT_IP=${SUBNET_PREFIX}.4
- LUIGI_PG=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-pg/safeline-ce?sslmode=disable
volumes:
- ${SAFELINE_DIR}/resources/luigi:/app/data
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
depends_on:
- detect
- mgt
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.7
fvm:
container_name: safeline-fvm
restart: always
image: ${IMAGE_PREFIX}/safeline-fvm${REGION}${ARCH_SUFFIX}:${IMAGE_TAG}
environment:
- TZ=Asia/Shanghai
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.8
chaos:
container_name: safeline-chaos
restart: always
image: ${IMAGE_PREFIX}/safeline-chaos${REGION}${ARCH_SUFFIX}:${IMAGE_TAG}
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "10"
environment:
- DB_ADDR=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-pg/safeline-ce?sslmode=disable
volumes:
- ${SAFELINE_DIR}/resources/sock:/app/sock
- ${SAFELINE_DIR}/resources/chaos:/app/chaos
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.10

Expected behavior

ImmortalWrt 24.10.4-r33602-e717d133ed6d
雷池9.2.8

Error log

root@WeiFHWrt:/data/safeline# docker logs safeline-mgt --tail=200
2025/12/05 20:56:10 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:10 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:10 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:10 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:10 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:10 [notice] 8#8: start worker processes
2025/12/05 20:56:10 [notice] 8#8: start worker process 9
2025/12/05 20:56:10 [notice] 8#8: start worker process 10
2025/12/05 20:56:10 [notice] 8#8: start worker process 11
2025/12/05 20:56:10 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:13 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:13 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:13 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:13 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:13 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:13 [notice] 8#8: start worker processes
2025/12/05 20:56:13 [notice] 8#8: start worker process 9
2025/12/05 20:56:13 [notice] 8#8: start worker process 10
2025/12/05 20:56:13 [notice] 8#8: start worker process 11
2025/12/05 20:56:13 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:15 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:15 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:15 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:15 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:15 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:15 [notice] 8#8: start worker processes
2025/12/05 20:56:15 [notice] 8#8: start worker process 9
2025/12/05 20:56:15 [notice] 8#8: start worker process 10
2025/12/05 20:56:15 [notice] 8#8: start worker process 11
2025/12/05 20:56:15 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:16 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:16 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:16 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:16 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:16 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:16 [notice] 8#8: start worker processes
2025/12/05 20:56:16 [notice] 8#8: start worker process 9
2025/12/05 20:56:16 [notice] 8#8: start worker process 10
2025/12/05 20:56:16 [notice] 8#8: start worker process 11
2025/12/05 20:56:16 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:18 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:18 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:18 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:18 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:18 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:18 [notice] 8#8: start worker processes
2025/12/05 20:56:18 [notice] 8#8: start worker process 9
2025/12/05 20:56:18 [notice] 8#8: start worker process 10
2025/12/05 20:56:18 [notice] 8#8: start worker process 11
2025/12/05 20:56:18 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:21 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:21 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:21 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:21 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:21 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:21 [notice] 8#8: start worker processes
2025/12/05 20:56:21 [notice] 8#8: start worker process 9
2025/12/05 20:56:21 [notice] 8#8: start worker process 10
2025/12/05 20:56:21 [notice] 8#8: start worker process 11
2025/12/05 20:56:21 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:25 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:25 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:25 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:25 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:25 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:25 [notice] 8#8: start worker processes
2025/12/05 20:56:25 [notice] 8#8: start worker process 9
2025/12/05 20:56:25 [notice] 8#8: start worker process 10
2025/12/05 20:56:25 [notice] 8#8: start worker process 11
2025/12/05 20:56:25 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:33 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:33 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:33 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:33 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:33 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:33 [notice] 8#8: start worker processes
2025/12/05 20:56:33 [notice] 8#8: start worker process 9
2025/12/05 20:56:33 [notice] 8#8: start worker process 10
2025/12/05 20:56:33 [notice] 8#8: start worker process 11
2025/12/05 20:56:33 [notice] 8#8: start worker process 12
2025/12/05 20:56:33 [error] 9#9: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: , request: "POST /api/open/publish/server HTTP/1.1", upstream: "http://[::1]:8000/api/open/publish/server", host: "172.19.0.4:1443"
2025/12/05 20:56:33 [warn] 9#9: *1 upstream server temporarily disabled while connecting to upstream, client: 172.19.0.1, server: , request: "POST /api/open/publish/server HTTP/1.1", upstream: "http://[::1]:8000/api/open/publish/server", host: "172.19.0.4:1443"
2025/12/05 20:56:33 [error] 9#9: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.19.0.1, server: , request: "POST /api/open/publish/server HTTP/1.1", upstream: "http://127.0.0.1:8000/api/open/publish/server", host: "172.19.0.4:1443"
2025/12/05 20:56:33 [warn] 9#9: *1 upstream server temporarily disabled while connecting to upstream, client: 172.19.0.1, server: , request: "POST /api/open/publish/server HTTP/1.1", upstream: "http://127.0.0.1:8000/api/open/publish/server", host: "172.19.0.4:1443"
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c
2025/12/05 20:56:47 [notice] 7#7: using the "epoll" event method
2025/12/05 20:56:47 [notice] 7#7: nginx/1.28.0
2025/12/05 20:56:47 [notice] 7#7: built by gcc 14.2.0 (Alpine 14.2.0)
2025/12/05 20:56:47 [notice] 7#7: OS: Linux 6.6.110
2025/12/05 20:56:47 [notice] 7#7: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/12/05 20:56:47 [notice] 8#8: start worker processes
2025/12/05 20:56:47 [notice] 8#8: start worker process 9
2025/12/05 20:56:47 [notice] 8#8: start worker process 10
2025/12/05 20:56:47 [notice] 8#8: start worker process 11
2025/12/05 20:56:47 [notice] 8#8: start worker process 12
panic: failed to init pg db: failed to connect to host=safeline-pg user=safeline-ce database=safeline-ce: dial error (dial tcp 172.19.0.2:5432: connect: connection refused)

goroutine 1 [running]:
main.main()
/work/main.go:32 +0x24c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions