goharbor/harbor · error

missing required headers

Error message

missing required headers

What it means

Validation in PreheatImage.Validate: the Headers map is empty. Preheating requests require authentication/scheme headers for the registry, so an empty header set is rejected.

Solutions

  1. Include the required headers (typically the Harbor auth header) in the preheat image JSON
  2. Regenerate the policy parameters so the controller injects the current credentials
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/pkg/p2p/preheat/provider/preheat_image.go:91 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/7f60d4ac521d27b0. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/p2p/preheat/provider/preheat_image.go:91

	if err != nil {
		return "", fmt.Errorf("encode preheating image error: %w", err)
	}

	return string(data), nil
}

// Validate PreheatImage
func (img *PreheatImage) Validate() error {
	if !slices.Contains(SupportedTypes, img.Type) {
		return fmt.Errorf("unsupported type '%s'", img.Type)
	}

	if len(img.ImageName) == 0 || len(img.Tag) == 0 {
		return errors.New("missing image repository or tag")
	}

	if len(img.Headers) == 0 {
		return errors.New("missing required headers")
	}

	_, err := url.Parse(img.URL)
	if err != nil {
		return fmt.Errorf("malformed registry URL: %w", err)
	}

	return nil
}

View on GitHub (pinned to 7b2fd08cc5)