{"record":{"id":"8c5d615b28d1321d","repo":"AlistGo/alist","slug":"chunk-upload-failed-with-code-d","errorCode":null,"errorMessage":"chunk upload failed with code %d","messagePattern":"chunk upload failed with code (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/bitqiu/driver.go","lineNumber":525,"sourceCode":"\t\t\t\"serialnumber\": initData.SerialNumber,\n\t\t\t\"hash\":         md5sum,\n\t\t\t\"len\":          strconv.FormatInt(chunkLen, 10),\n\t\t\t\"offset\":       strconv.FormatInt(offset, 10),\n\t\t\t\"user-agent\":   d.userAgent(),\n\t\t}\n\n\t\tvar chunkResp ChunkUploadResponse\n\t\treq := d.client.R().\n\t\t\tSetContext(ctx).\n\t\t\tSetHeaders(headers).\n\t\t\tSetBody(chunkBuf).\n\t\t\tSetResult(&chunkResp)\n\n\t\tif _, err := req.Post(initData.UploadURL); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif chunkResp.ErrCode != 0 {\n\t\t\treturn \"\", fmt.Errorf(\"chunk upload failed with code %d\", chunkResp.ErrCode)\n\t\t}\n\t\tfinishedFlag = chunkResp.FinishedFlag\n\t\toffset += chunkLen\n\t\tup(float64(offset) * 100 / float64(size))\n\t}\n\n\tif finishedFlag == \"\" {\n\t\treturn \"\", fmt.Errorf(\"upload finished without server code\")\n\t}\n\treturn finishedFlag, nil\n}\n\nfunc (d *BitQiu) completeChunkUpload(ctx context.Context, initData UploadInitData, parentID, parentPath, name string, size int64, md5sum, serverCode string) (model.Obj, error) {\n\tform := map[string]string{\n\t\t\"currentPage\": \"1\",\n\t\t\"limit\":       \"1\",\n\t\t\"userId\":      strconv.FormatInt(initData.UserID, 10),\n\t\t\"status\":      \"0\",","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/bitqiu/driver.go#L507-L543","documentation":"Error \"chunk upload failed with code %d\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/bitqiu/driver.go:525 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}