kubernetes/kops · error

error fetching recordset images for upsert operation

Error message

error fetching recordset images for upsert operation: %v

What it means

Wraps a failure of rrsets.List in the CloudDNS changeset Apply when upserts are present: the provider must fetch the current record sets to compute the before/after diff, and that listing failed before the change was submitted.

Solutions

  1. Check GCP credentials and DNS API scope
  2. Verify the managed zone is accessible
  3. Retry the apply
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at dnsprovider/pkg/dnsprovider/providers/google/clouddns/rrchangeset.go:77 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/2c07f3cf40a6dba8. Report an issue: GitHub.

Appendix: source

Thrown at dnsprovider/pkg/dnsprovider/providers/google/clouddns/rrchangeset.go:77

	rrsets := c.rrsets

	service := rrsets.zone.zones.interface_.service.Changes()

	var additions []interfaces.ResourceRecordSet
	for _, r := range c.additions {
		additions = append(additions, r.(ResourceRecordSet).impl)
	}
	var deletions []interfaces.ResourceRecordSet
	for _, r := range c.removals {
		deletions = append(deletions, r.(ResourceRecordSet).impl)
	}

	if len(c.upserts) != 0 {
		// TODO: We could maybe tweak this to fetch just the records we care about
		// although not clear when this would be a win.  N=1 obviously so though...
		before, err := c.rrsets.List()
		if err != nil {
			return fmt.Errorf("error fetching recordset images for upsert operation: %v", err)
		}

		upsertMap := make(map[string]dnsprovider.ResourceRecordSet)
		for _, upsert := range c.upserts {
			key := string(upsert.Type()) + "::" + upsert.Name()
			upsertMap[key] = upsert
		}

		for _, b := range before {
			key := string(b.Type()) + "::" + b.Name()
			upsert := upsertMap[key]
			if upsert == nil {
				continue
			}

			deletions = append(deletions, b.(ResourceRecordSet).impl)
			additions = append(additions, upsert.(ResourceRecordSet).impl)

View on GitHub (pinned to 4c8573c808)