{"record":{"id":"9b05e53066cb323e","repo":"router-for-me/CLIProxyAPI","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/home/certificate.go","lineNumber":378,"sourceCode":"\t\t}\n\t\tsize, errSize := strconv.Atoi(strings.TrimSpace(line))\n\t\tif errSize != nil {\n\t\t\treturn nil, errSize\n\t\t}\n\t\tif size < 0 {\n\t\t\treturn nil, fmt.Errorf(\"home certificate request returned nil\")\n\t\t}\n\t\tpayload := make([]byte, size+2)\n\t\tif _, errFull := io.ReadFull(reader, payload); errFull != nil {\n\t\t\treturn nil, errFull\n\t\t}\n\t\treturn payload[:size], nil\n\tcase '-':\n\t\tline, errLine := reader.ReadString('\\n')\n\t\tif errLine != nil {\n\t\t\treturn nil, errLine\n\t\t}\n\t\treturn nil, fmt.Errorf(\"%s\", strings.TrimSpace(line))\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"home certificate request returned unsupported resp prefix %q\", prefix)\n\t}\n}\n\nfunc fileExists(path string) bool {\n\tinfo, errStat := os.Stat(path)\n\treturn errStat == nil && !info.IsDir()\n}\n","sourceCodeStart":360,"sourceCodeEnd":388,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/home/certificate.go#L360-L388","documentation":"This is the RESP error-line branch of readRESPBulk in internal/home/certificate.go: the reply began with '-' (RESP error), so the raw error line from the home/Redis server is surfaced verbatim as the error message. It is a pass-through of the server's own error text (e.g. ERR unknown command, WRONGPASS, NOAUTH).","triggerScenarios":"Any server-side RESP error during the certificate exchange: unknown command sent to a non-home Redis, auth failure (NOAUTH/WRONGPASS), cluster MOVED/ASK redirections surfaced as errors, or an enrollment-domain error string produced by the home server.","commonSituations":"Client pointed at a stock Redis that does not implement CERTIFICATE; Redis requires AUTH but credentials missing/wrong in config; Redis in cluster mode returning MOVED because the home server expects direct-to-slot access.","solutions":["Read the surfaced server message — it names the exact server-side problem (NOAUTH => set password; ERR unknown command 'CERTIFICATE' => wrong server type; WRONGPASS => fix credentials)","Point the home client at the actual home/Redis-compatible endpoint that implements the enrollment commands","If MOVED/ASK appears, connect to the redirected node or use a non-cluster address"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil {\n    msg := err.Error()\n    switch {\n    case strings.Contains(msg, \"NOAUTH\"), strings.Contains(msg, \"WRONGPASS\"):\n        return fmt.Errorf(\"home auth failed — check password config: %s\", msg)\n    case strings.Contains(msg, \"unknown command\"):\n        return fmt.Errorf(\"endpoint is not a home server: %s\", msg)\n    case strings.Contains(msg, \"MOVED\"), strings.Contains(msg, \"ASK\"):\n        return fmt.Errorf(\"cluster redirect — connect to the redirected node: %s\", msg)\n    }\n}","preventionTips":["Smoke-test the endpoint with redis-cli PING before enabling the feature","Keep home credentials in the same secret-management flow as other service credentials"],"tags":["go","resp","redis","protocol","home"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}