{"record":{"id":"fd049a9a81afe5fd","repo":"AlistGo/alist","slug":"err-error","errorCode":null,"errorMessage":"err.Error()","messagePattern":"err\\.Error\\(\\)","errorType":"http","errorClass":null,"httpStatus":416,"severity":"error","filePath":"internal/net/serve.go","lineNumber":126,"sourceCode":"\n\tif sumRangesSize(ranges) > size {\n\t\t// The total number of bytes in all the ranges is larger than the size of the file\n\t\t// or unknown file size, ignore the range request.\n\t\tranges = nil\n\t}\n\n\t// 使用请求的Context\n\t// 不然从sendContent读不到数据，即使请求断开CopyBuffer也会一直堵塞\n\tctx := context.WithValue(r.Context(), \"request_header\", r.Header)\n\tswitch {\n\tcase len(ranges) == 0:\n\t\treader, err := RangeReadCloser.RangeRead(ctx, http_range.Range{Length: -1})\n\t\tif err != nil {\n\t\t\tcode = http.StatusRequestedRangeNotSatisfiable\n\t\t\tif err == ErrExceedMaxConcurrency {\n\t\t\t\tcode = http.StatusTooManyRequests\n\t\t\t}\n\t\t\thttp.Error(w, err.Error(), code)\n\t\t\treturn nil\n\t\t}\n\t\tsendContent = reader\n\tcase len(ranges) == 1:\n\t\t// RFC 7233, Section 4.1:\n\t\t// \"If a single part is being transferred, the server\n\t\t// generating the 206 response MUST generate a\n\t\t// Content-Range header field, describing what range\n\t\t// of the selected representation is enclosed, and a\n\t\t// payload consisting of the range.\n\t\t// ...\n\t\t// A server MUST NOT generate a multipart response to\n\t\t// a request for a single range, since a client that\n\t\t// does not request multiple parts might not support\n\t\t// multipart responses.\"\n\t\tra := ranges[0]\n\t\tsendContent, err = RangeReadCloser.RangeRead(ctx, ra)\n\t\tif err != nil {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/net/serve.go#L108-L144","documentation":"Error \"err.Error()\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at internal/net/serve.go:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the storage configuration and the provider's service status, fix the indicated cause, and retry the operation."],"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"}