{"record":{"id":"ca95a911b0929f18","repo":"goharbor/harbor","slug":"failed-to-get-upload-status-w","errorCode":null,"errorMessage":"failed to get upload status: %w","messagePattern":"failed to get upload status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/registry/client.go","lineNumber":461,"sourceCode":"\tif lastChunk {\n\t\tmethod = http.MethodPut\n\t}\n\treq, err := http.NewRequest(method, url, chunk)\n\tif err != nil {\n\t\treturn location, end, err\n\t}\n\n\treq.ContentLength = end - start + 1\n\treq.Header.Set(\"Content-Range\", fmt.Sprintf(\"%d-%d\", start, end))\n\tresp, err := c.do(req)\n\tif err != nil {\n\t\t// if push chunk error, we should query the upload progress for new location and end range.\n\t\tnewLocation, newEnd, err1 := c.getUploadStatus(url)\n\t\tif err1 == nil {\n\t\t\treturn newLocation, newEnd, err\n\t\t}\n\t\t// end should return start-1 to re-push this chunk\n\t\treturn location, start - 1, fmt.Errorf(\"failed to get upload status: %w\", err1)\n\t}\n\n\tdefer resp.Body.Close()\n\t// return the location for next chunk upload\n\treturn resp.Header.Get(\"Location\"), end, nil\n}\n\nfunc (c *client) getUploadStatus(location string) (string, int64, error) {\n\treq, err := http.NewRequest(http.MethodGet, location, nil)\n\tif err != nil {\n\t\treturn location, -1, err\n\t}\n\n\tresp, err := c.do(req)\n\tif err != nil {\n\t\treturn location, -1, err\n\t}\n","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/registry/client.go#L443-L479","documentation":"Error \"failed to get upload status: %w\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/registry/client.go:461 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}