{"record":{"id":"9f9443855d76641d","repo":"goharbor/harbor","slug":"invalid-content-range-format-s","errorCode":null,"errorMessage":"invalid content range format, %s","messagePattern":"invalid content range format, (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/registry/client.go","lineNumber":493,"sourceCode":"\tresp, err := c.do(req)\n\tif err != nil {\n\t\treturn location, -1, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\t_, end, err := parseContentRange(resp.Header.Get(\"Range\"))\n\tif err != nil {\n\t\treturn location, -1, err\n\t}\n\n\treturn resp.Header.Get(\"Location\"), end, nil\n}\n\nfunc parseContentRange(cr string) (int64, int64, error) {\n\tranges := strings.Split(cr, \"-\")\n\tif len(ranges) != 2 {\n\t\treturn -1, -1, fmt.Errorf(\"invalid content range format, %s\", cr)\n\t}\n\tstart, err := strconv.ParseInt(ranges[0], 10, 64)\n\tif err != nil {\n\t\treturn -1, -1, err\n\t}\n\tend, err := strconv.ParseInt(ranges[1], 10, 64)\n\tif err != nil {\n\t\treturn -1, -1, err\n\t}\n\n\treturn start, end, nil\n}\n\nfunc (c *client) initiateBlobUpload(repository string) (string, string, error) {\n\treq, err := http.NewRequest(http.MethodPost, buildInitiateBlobUploadURL(c.url, repository), nil)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/registry/client.go#L475-L511","documentation":"Returned by parseContentRange when the Range header value from a registry upload-status response does not have exactly one '-' separator (e.g. 'start-end'). The registry returned a malformed or missing Range header, so the uploaded byte offset cannot be determined. The input at fault is the Range header string from the response.","triggerScenarios":"Thrown at src/pkg/registry/client.go:493 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw Range header the registry returned","Verify the registry implements the Docker Registry v2 blob upload spec correctly","Restart the blob upload if the session state is corrupt","Report the non-conforming registry implementation if it persists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}