goharbor/harbor · error
failed to get upload status
Error message
failed to get upload status: %w
What it means
Returned by PushBlobChunk when a chunk push fails AND the follow-up getUploadStatus query to recover the upload progress also fails. It wraps the status-query error (%w) while returning end=start-1 so the caller re-pushes the chunk. The root cause is a broken upload session: both the chunk PUT and the progress GET failed.
Solutions
- Inspect the wrapped getUploadStatus error for the underlying failure
- Verify the upload session/location URL is still valid (not expired or GC'd)
- Restart the blob upload from the beginning with a new session
- Check registry connectivity and retry the push
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/pkg/registry/client.go:461 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16).
Data as JSON: /api/errors/ca95a911b0929f18.
Report an issue: GitHub.
Appendix: source
Thrown at src/pkg/registry/client.go:461
if lastChunk {
method = http.MethodPut
}
req, err := http.NewRequest(method, url, chunk)
if err != nil {
return location, end, err
}
req.ContentLength = end - start + 1
req.Header.Set("Content-Range", fmt.Sprintf("%d-%d", start, end))
resp, err := c.do(req)
if err != nil {
// if push chunk error, we should query the upload progress for new location and end range.
newLocation, newEnd, err1 := c.getUploadStatus(url)
if err1 == nil {
return newLocation, newEnd, err
}
// end should return start-1 to re-push this chunk
return location, start - 1, fmt.Errorf("failed to get upload status: %w", err1)
}
defer resp.Body.Close()
// return the location for next chunk upload
return resp.Header.Get("Location"), end, nil
}
func (c *client) getUploadStatus(location string) (string, int64, error) {
req, err := http.NewRequest(http.MethodGet, location, nil)
if err != nil {
return location, -1, err
}
resp, err := c.do(req)
if err != nil {
return location, -1, err
}
View on GitHub (pinned to 7b2fd08cc5)