{"record":{"id":"61cb7e8d71e3d76b","repo":"chenhg5/cc-connect","slug":"qq-http-url-not-configured","errorCode":null,"errorMessage":"qq: http_url not configured","messagePattern":"qq: http_url not configured","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/qq/qq.go","lineNumber":592,"sourceCode":"\t\tif resp.RetCode != 0 {\n\t\t\treturn nil, fmt.Errorf(\"qq: API %s failed (retcode=%d)\", action, resp.RetCode)\n\t\t}\n\t\tvar result map[string]any\n\t\t_ = json.Unmarshal(resp.Data, &result)\n\t\treturn result, nil\n\n\tcase <-time.After(15 * time.Second):\n\t\treturn nil, fmt.Errorf(\"qq: API %s timeout\", action)\n\t}\n}\n\n// callHTTPAPI calls a OneBot v11 HTTP endpoint (e.g. /upload_group_file).\n// Used for file operations — avoids WebSocket message size limits and\n// file-path issues across Windows/WSL/Docker boundaries.\n// Requires http_url to be configured.\nfunc (p *Platform) callHTTPAPI(action string, params map[string]any) (map[string]any, error) {\n\tif p.httpURL == \"\" {\n\t\treturn nil, fmt.Errorf(\"qq: http_url not configured\")\n\t}\n\tbody, err := json.Marshal(params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\turl := p.httpURL + \"/\" + action\n\treq, err := http.NewRequest(\"POST\", url, bytes.NewReader(body))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tif p.token != \"\" {\n\t\treq.Header.Set(\"Authorization\", \"Bearer \"+p.token)\n\t}\n\tclient := &http.Client{Timeout: 120 * time.Second}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"qq: HTTP %s failed: %w\", action, err)","sourceCodeStart":574,"sourceCodeEnd":610,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/qq/qq.go#L574-L610","documentation":"Returned by callHTTPAPI when p.httpURL is empty. The HTTP path (used by parseMessage-driven file operations like /upload_group_file) requires a OneBot HTTP endpoint to be configured because WebSocket cannot handle large file uploads or cross-host file paths. Without http_url, file operations simply cannot run.","triggerScenarios":"Any file operation routed to callHTTPAPI (e.g. upload_group_file triggered from a parsed message) while the qq platform config omits http_url.","commonSituations":"Deployments configured for WebSocket-only OneBot access; config.toml missing the http_url key after an upgrade that introduced HTTP file upload; reverse proxy exposing only the WS endpoint, not the HTTP API port.","solutions":["Add http_url to the qq platform config pointing at the OneBot HTTP endpoint (e.g. \"http://127.0.0.1:5700\").","Ensure the OneBot implementation has its HTTP server enabled on that address/port (not just the WS server).","If you only need WS, avoid the file-upload features that require the HTTP API, or upgrade your OneBot setup to expose HTTP.","Verify the URL is reachable from the cc-connect host: curl http://<host>:<port>/get_login_info."],"exampleFix":"// before (config.toml)\n[platforms.qq]\nws_url = \"ws://127.0.0.1:6700\"\n\n// after\n[platforms.qq]\nws_url = \"ws://127.0.0.1:6700\"\nhttp_url = \"http://127.0.0.1:5700\"","handlingStrategy":"validation","validationCode":"if cfg.QQ.HTTPURL == \"\" {\n    return fmt.Errorf(\"qq platform requires http_url for file operations\")\n}\nu, err := url.Parse(cfg.QQ.HTTPURL)\nif err != nil || u.Scheme != \"http\" && u.Scheme != \"https\" {\n    return fmt.Errorf(\"invalid qq http_url: %q\", cfg.QQ.HTTPURL)\n}\nresp, err := http.Get(cfg.QQ.HTTPURL + \"/get_login_info\")\nif err != nil {\n    return fmt.Errorf(\"onebot http endpoint unreachable: %w\", err)\n}\nresp.Body.Close()","typeGuard":null,"tryCatchPattern":"result, err := p.callHTTPAPI(\"upload_group_file\", params)\nif err != nil {\n    if strings.Contains(err.Error(), \"http_url not configured\") {\n        return fmt.Errorf(\"file upload unavailable: add http_url to the qq platform config\")\n    }\n    return err\n}","preventionTips":["Always configure http_url alongside ws_url for full-featured deployments","Enable the OneBot HTTP server, not just the WS server","Probe the HTTP endpoint at startup and warn early if missing","Validate config keys against the platform's required fields on load"],"tags":["configuration","http","onebot","file-upload"],"backgroundTag":"missing-required-config-field","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}