{"record":{"id":"b083fe8c0b0e1b57","repo":"chenhg5/cc-connect","slug":"too-many-redirects-b083fe","errorCode":null,"errorMessage":"too many redirects","messagePattern":"too many redirects","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/update.go","lineNumber":395,"sourceCode":"\t\tif _, err := io.Copy(tmp, rc); err != nil {\n\t\t\ttmp.Close()\n\t\t\trc.Close()\n\t\t\tos.Remove(tmp.Name())\n\t\t\treturn \"\", fmt.Errorf(\"extract: %w\", err)\n\t\t}\n\t\trc.Close()\n\t\ttmp.Close()\n\t\treturn tmp.Name(), nil\n\t}\n\treturn \"\", fmt.Errorf(\"binary not found in archive\")\n}\n\nfunc downloadToTemp(url string) (string, error) {\n\tclient := &http.Client{\n\t\tTimeout: 5 * time.Minute,\n\t\tCheckRedirect: func(req *http.Request, via []*http.Request) error {\n\t\t\tif len(via) >= 10 {\n\t\t\t\treturn fmt.Errorf(\"too many redirects\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tresp, err := client.Get(url)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"download: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 {\n\t\treturn \"\", fmt.Errorf(\"download returned HTTP %d\", resp.StatusCode)\n\t}\n\n\ttmp, err := os.CreateTemp(\"\", \"cc-connect-update-*\")\n\tif err != nil {\n\t\treturn \"\", err","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/update.go#L377-L413","documentation":"A sentinel returned by the HTTP client's CheckRedirect hook in downloadToTemp: the release download URL redirected more than 10 times. It fires on redirect loops (misconfigured release mirrors or GitHub URL weirdness); the client aborts the download.","triggerScenarios":"Thrown at cmd/cc-connect/update.go:395 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry later — transient redirect loops on CDN edges resolve themselves","Verify the release URL/asset still exists on the releases page","If persistent, download manually and replace the binary"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}