启动: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”: “lan”,
“controlUi”: {
“enabled”: true,
“allowedOrigins”: [
“http://localhost:18789”,
“http://127.0.0.1:18789”,
“http://60.205.7.106:18789”
],
“allowInsecureAuth”: true,
“dangerouslyDisableDeviceAuth”: true,
“dangerouslyAllowHostHeaderOriginFallback”: true
},
“auth”: {
“mode”: “token”,
“token”: “ac8”
},
“trustedProxies”: [
“0.0.0.0/0”
],
报错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
报错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’,
https://github.com/openclaw/openclaw/issues/17608
https://github.com/openclaw/openclaw/issues/2248
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/cloud/319343.html