根据你提供的日志,OpenClaw 的 gateway 服务已经成功启动,监听在ws://127.0.0.1:18789,但后续的 WebSocket 连接尝试均因为缺少认证 token 而被拒绝(unauthorized: gateway token missing)。这通常是你在通过浏览器或 Control UI 访问时需要提供正确的 token。
为什么打不开?
OpenClaw 的 gateway 默认启用了 token 认证,以防止未授权访问。
日志显示有多个连接尝试(例如来自
openclaw-control-ui或浏览器)没有携带 token,因此被服务器拒绝并断开(错误码 1008)。
如何解决?
打开 dashboard 获取 token
日志中提到open the dashboard URL and paste the token in Control UI settings。用浏览器访问 OpenClaw 提供的 dashboard 地址,通常是
http://127.0.0.1:18789/(或http://localhost:18789/)。页面会显示一个 token(通常是一串随机字符),复制它。
在 Control UI 中配置 token
如果你使用的是 OpenClaw 的 Control UI 客户端(可能是桌面应用或网页),在设置中找到类似“Gateway Token”的输入框,粘贴刚才复制的 token。重新连接
配置好 token 后,刷新或重新连接,应该就能正常访问了。
其他注意事项
日志中还有关于飞书(feishu)插件的警告:
channels.feishu.groupPolicy is "allowlist" but groupAllowFrom (and allowFrom) is empty,这表示飞书群组消息会被丢弃,但不会影响 gateway 的启动。如果需要接收飞书消息,可以按提示配置groupAllowFrom或修改groupPolicy为"open"。如果仍然无法打开,请检查防火墙是否允许 18789 端口的访问,或确认是否有其他服务占用了该端口。
我们被问到“为什么openclaw打不开?” 用户提供了一个日志文件的内容。日志显示运行了openclaw gateway命令,然后输出了一些信息,最后有很多WebSocket连接错误,提示“unauthorized: gateway token missing (open the dashboard URL and paste the token in Control UI settings)”。所以问题应该是OpenClaw无法打开,可能是因为缺少认证token。
我们需要根据日志解释问题原因和解决方法。日志显示OpenClaw gateway已经启动,监听在ws://127.0.0.1:18789,但WebSocket连接尝试失败,因为缺少token。Control UI尝试连接但没有提供token,被拒绝。
可能用户尝试通过浏览器或其他方式访问,但需要配置token。根据日志中的提示:unauthorized: gateway token missing (open the dashboard URL and paste the token in Control UI settings)。所以解决方法是需要获取token并配置到Control UI中。也许token在启动时显示在dashboard URL上?但日志中没有看到token被打印出来。可能token是自动生成的,需要从某个地方获取。
日志中还有警告:channels.feishu.groupPolicy is "allowlist" but groupAllowFrom (and allowFrom) is empty,这可能导致飞书消息被丢弃,但这不是打不开的主要原因。
因此,回答应该指出:OpenClaw gateway已经启动,但WebSocket连接需要认证token。用户需要打开dashboard URL(可能是http://127.0.0.1:18789/),然后获取token,并在Control UI设置中粘贴该token。另外,也可能需要检查防火墙或浏览器访问。
我们还可以建议检查配置文件中的plugins.allow设置,避免插件自动加载的警告,但这不是关键。
所以最终答案:解释问题是因为token缺失,提供解决方法。