目录

开源版 OpenClaw 部署常见问题解决


一、cannot join network namespace of container

错误信息

1
2
3
4
5
6
Docker gateway defaults
 Container openclaw-gateway Starting 
 Container openclaw-gateway Started 
 Container openclaw-git-openclaw-cli-run-xxx Creating 
 Container openclaw-git-openclaw-cli-run-xxx Created 
Error response from daemon: cannot join network namespace of container: Container

原因

openclaw-cli 容器正试图加入 openclaw-gateway 容器的网络空间,但此时 gateway 容器并没有处于稳定运行状态(它正在反复重启或启动失败)

解决

需要进一步查看 openclaw-gateway 的日志来排查

如果是docker启动,则用 sudo docker logs openclaw-gateway(或其他 container name) 来查看日志


二、non-loopback Control UI requires gateway.controlUi.allowedOrigins

错误信息

1
Gateway failed to start: Error: non-loopback Control UI requires gateway.controlUi.allowedOrigins (set explicit origins), or set gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true to use Host-header origin fallback mode

原因

OpenClaw Gateway 在启动时遇到了 安全配置校验失败

简单来说,由于你是在 Docker 环境中运行(属于非回环地址 non-loopback),系统为了防止 跨站请求伪造 (CSRF) 等攻击,强制要求你明确指定允许访问控制界面的域名或 IP

解决

修改 .openclaw/openclaw.json

在 gateway 节点下

1、修改 bind 为 lan

2、增加 controlUi.allowedOrigins ,里边填写你允许访问的地址

1
2
3
4
5
6
7
8
    "bind": "lan",
    "controlUi": {
      "allowedOrigins": [
        "http://172.20.0.22:18789",
        "https://172.20.0.22:20789",
        "https://47.96.30.40:20789"
      ]
    }

三、pairing required

错误信息

打开 openclaw 的网页端,出现红色字体: pairing required

原因

这是 openclaw 的安全机制,新设备(新浏览器)首次访问,需要手动在服务器上完成一次设备授权。

解决

1、执行该命令找到新设备

1
2
3
4
5
# 如果是在 docker 中运行
sudo docker exec -it openclaw-gateway /bin/bash -c './openclaw.mjs devices list'

# 如果不是在 docker 中运行
openclaw devices list

2、增加授权

1
2
3
4
5
# 如果是在 docker 中运行
sudo docker exec -it openclaw-gateway /bin/bash -c './openclaw.mjs approve <requestId>'

# 如果不是在 docker 中运行
openclaw devices approve <requestId>