启动:openclaw gateway --bind lan --port 18789 --verbose

访问界面

报错1:origin not allowed (open the Control UI from the gateway host or allow it in gateway.controlUi.allowedOrigins)

解决:

 vim ~/.openclaw/openclaw.json

gateway.controlUi下增加:

allowedOrigins": ["http://10.10.xxx.xxx:端口"]   #浏览器访问的地址,不要使用*

完整的片段如下:

  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
"controlUi": {
  "allowedOrigins": ["http://10.10.xxx.xxxx:18789"]
},

报错2:control ui requires device identity (use HTTPS or localhost secure context)

 解决:

vim ~/.openclaw/openclaw.json,增加:

      "allowInsecureAuth": true,
      "dangerouslyDisableDeviceAuth": true

完整的片段如下:

  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
"controlUi": {
  "allowedOrigins": ["http://10.10.xxx.xxxx:18789"],
  "allowInsecureAuth": true,
  "dangerouslyDisableDeviceAuth": true
},

报错3:device identity required

解决:

服务器执行openclaw dashboard,获取到token=xxxxxxxx

拼接到浏览器地址里访问,注意加&拼接

如:​http://10.10.xxxx:18789/chat?session=main&token=xxxxxxx​

如果还是报device identity required,尝试浏览器访问

http://10.10.xxxx:18789/#token=xxxxxxx​

报错4:Agent failed before reply: Model context window too small (4096 tokens). Minimum is 16000. Logs: openclaw logs --follow

 解决:

vim ~/.openclaw/openclaw.json

修改models里的两个参数为

"contextWindow": 16000, "maxTokens": 16000

报错5:400 status code (no body)

解决:模型调用问题,可以先使用阿里云的调试

主要修改

'baseUrl': 'https://dashscope.aliyuncs.com/compatible-mode/v1',
    'apiKey': 'sk-你的百炼APIKey',
    'api': 'openai-completions',
    'models': [
        {
            'id': 'qwen-plus',

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐