{"record":{"id":"0daa157c7d50f842","repo":"AlistGo/alist","slug":"read-chunk-failed-w","errorCode":null,"errorMessage":"read chunk failed: %w","messagePattern":"read chunk failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/bitqiu/driver.go","lineNumber":498,"sourceCode":"\t}\n\tif size <= 0 {\n\t\treturn \"\", fmt.Errorf(\"invalid file size\")\n\t}\n\tbuf := make([]byte, chunkSize)\n\toffset := int64(0)\n\tvar finishedFlag string\n\n\tfor offset < size {\n\t\tchunkLen := chunkSize\n\t\tremaining := size - offset\n\t\tif remaining < chunkLen {\n\t\t\tchunkLen = remaining\n\t\t}\n\n\t\treader := io.NewSectionReader(tmpFile, offset, chunkLen)\n\t\tchunkBuf := buf[:chunkLen]\n\t\tif _, err := io.ReadFull(reader, chunkBuf); err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"read chunk failed: %w\", err)\n\t\t}\n\n\t\theaders := map[string]string{\n\t\t\t\"accept\":       \"*/*\",\n\t\t\t\"content-type\": \"application/octet-stream\",\n\t\t\t\"appid\":        initData.AppID,\n\t\t\t\"token\":        initData.Token,\n\t\t\t\"userid\":       strconv.FormatInt(initData.UserID, 10),\n\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).","sourceCodeStart":480,"sourceCodeEnd":516,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/bitqiu/driver.go#L480-L516","documentation":"Error \"read chunk failed: %w\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/bitqiu/driver.go:498 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"}