{"record":{"id":"1fcc7d35c1283658","repo":"AlistGo/alist","slug":"can-t-read-data-expected-d-got-d","errorCode":null,"errorMessage":"can't read data, expected=%d, got=%d","messagePattern":"can't read data, expected=(.+?), got=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/aliyundrive_open/upload.go","lineNumber":141,"sourceCode":"\t\tpr.End = size\n\t}\n\treturn pr, nil\n}\n\nfunc (d *AliyundriveOpen) calProofCode(stream model.FileStreamer) (string, error) {\n\tproofRange, err := getProofRange(d.getAccessToken(), stream.GetSize())\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tlength := proofRange.End - proofRange.Start\n\treader, err := stream.RangeRead(http_range.Range{Start: proofRange.Start, Length: length})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tbuf := make([]byte, length)\n\tn, err := io.ReadFull(reader, buf)\n\tif err == io.ErrUnexpectedEOF {\n\t\treturn \"\", fmt.Errorf(\"can't read data, expected=%d, got=%d\", len(buf), n)\n\t}\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn base64.StdEncoding.EncodeToString(buf), nil\n}\n\nfunc (d *AliyundriveOpen) upload(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (model.Obj, error) {\n\t// 1. create\n\t// Part Size Unit: Bytes, Default: 20MB,\n\t// Maximum number of slices 10,000, ≈195.3125GB\n\tvar partSize = calPartSize(stream.GetSize())\n\tconst dateFormat = \"2006-01-02T15:04:05.000Z\"\n\tmtimeStr := stream.ModTime().UTC().Format(dateFormat)\n\tctimeStr := stream.CreateTime().UTC().Format(dateFormat)\n\n\tcreateData := base.Json{\n\t\t\"drive_id\":          d.DriveId,","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/aliyundrive_open/upload.go#L123-L159","documentation":"Error \"can't read data, expected=%d, got=%d\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/aliyundrive_open/upload.go:141 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"}