{"record":{"id":"db528d8a32698c96","repo":"AlistGo/alist","slug":"res-status-db528d","errorCode":null,"errorMessage":"res.Status","messagePattern":"res\\.Status","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/cloudreve_v4/util.go","lineNumber":293,"sourceCode":"\t\t}\n\t\treq, err := http.NewRequest(\"POST\", uploadUrl+\"?chunk=\"+strconv.Itoa(chunk),\n\t\t\tdriver.NewLimitedUploadStream(ctx, bytes.NewReader(byteData)))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treq = req.WithContext(ctx)\n\t\treq.ContentLength = byteSize\n\t\t// req.Header.Set(\"Content-Length\", strconv.Itoa(int(byteSize)))\n\t\treq.Header.Set(\"Authorization\", fmt.Sprint(credential))\n\t\treq.Header.Set(\"User-Agent\", d.getUA())\n\t\terr = func() error {\n\t\t\tres, err := base.HttpClient.Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer res.Body.Close()\n\t\t\tif res.StatusCode != 200 {\n\t\t\t\treturn errors.New(res.Status)\n\t\t\t}\n\t\t\tbody, err := io.ReadAll(res.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tvar up Resp\n\t\t\terr = json.Unmarshal(body, &up)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif up.Code != 0 {\n\t\t\t\treturn errors.New(up.Msg)\n\t\t\t}\n\t\t\treturn nil\n\t\t}()\n\t\tif err == nil {\n\t\t\tretryCount = 0\n\t\t\tfinish += byteSize","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/cloudreve_v4/util.go#L275-L311","documentation":"CloudreveV4 local-policy chunked upload: the PUT of a chunk via base.HttpClient returned a non-200 HTTP status and res.Status (e.g. '410 Gone') is returned as the error. Same shape as the V3 driver's local upload failure but on the V4 API's credential URLs.","triggerScenarios":"upLocal loop: chunk request executed, res.StatusCode != 200. Caused by expired one-shot upload credentials, session invalidated server-side, range/size mismatch, or gateway rejection.","commonSituations":"Long uploads outliving the credential TTL (especially with backoff retries); Cloudrebve V4 restarted losing upload sessions; proxy body-size limits rejecting large chunks; clock skew invalidating signed URLs.","solutions":["Restart the upload (fresh session/credentials).","Reduce chunk size or parallelism so the session finishes before credentials expire.","Check proxy client_max_body_size / WAF rules on the chunk endpoint.","Sync system clock (NTS/NTP) on the alist host."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := chunkPut(); err != nil {\n    if res.Status != \"\" && isExpiredCredential(err) { // 401/403/410\n        d.renewUploadSession()\n        return chunkPut()\n    }\n    return err\n}","preventionTips":["Treat chunk credential expiry as expected: recreate sessions and retry once","Keep uploads moving; avoid long backoffs inside a live session","Sync clocks and check proxy limits on the chunk route"],"tags":["cloudreve-v4","upload","http-status","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}