{"record":{"id":"e7dc1fab8403b526","repo":"AlistGo/alist","slug":"up-msg-e7dc1f","errorCode":null,"errorMessage":"up.Msg","messagePattern":"up\\.Msg","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/cloudreve_v4/util.go","lineNumber":305,"sourceCode":"\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\n\t\t\tup(float64(finish) * 100 / float64(file.GetSize()))\n\t\t\tchunk++\n\t\t} else {\n\t\t\tretryCount++\n\t\t\tif retryCount > maxRetries {\n\t\t\t\treturn fmt.Errorf(\"upload failed after %d retries due to server errors, error: %s\", maxRetries, err)\n\t\t\t}\n\t\t\tbackoff := time.Duration(1<<retryCount) * time.Second\n\t\t\tutils.Log.Warnf(\"[Cloudreve-Remote] server errors while uploading, retrying after %v...\", backoff)\n\t\t\ttime.Sleep(backoff)\n\t\t}\n\t}","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/cloudreve_v4/util.go#L287-L323","documentation":"CloudreveV4 local upload chunk got HTTP 200 but the JSON envelope carries a non-zero code; the server's message up.Msg is returned. This is the application-level rejection of an otherwise HTTP-successful chunk PUT on V4.","triggerScenarios":"Chunk body unmarshals fine, up.Code != 0. Occurs when the upload session is completed/invalid, chunk index already committed, credential scope mismatch, or policy limits (size/count) exceeded.","commonSituations":"Retrying after a partial failure where earlier chunks already landed; resuming a finished session; per-policy file size cap hit mid-upload; duplicate uploads racing on the same session.","solutions":["Start a new upload instead of resuming — server-side session state is the usual culprit.","Raise the V4 storage policy size/chunk limits if failures cluster at a size boundary.","Avoid concurrent uploads of the identical file through this driver.","Correlate with V4 server logs for the precise code/message."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := d.upLocal(...); err != nil {\n    if strings.Contains(err.Error(), \"session\") { // up.Msg mentioning session state\n        return d.upLocal(...) // one clean restart with a new session\n    }\n    return err\n}","preventionTips":["Never resume a session you suspect is completed server-side","Cap parallel uploads of the same file to one","Correlate up.Code/up.Msg with V4 server logs"],"tags":["cloudreve-v4","upload","api-error","go"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}