kubernetes/kops · error

error rendering instances: %w

Error message

error rendering instances: %w

What it means

In the instance task's RenderScw, fi.ResourceAsBytes failed to serialize the expected UserData resource (the cloud-init payload) before creating servers. This is a local templating/resource-resolution failure, not a cloud API error — e.g. the user-data template could not be loaded or rendered.

Source

Thrown at upup/pkg/fi/cloudup/scalewaytasks/instance.go:183

			return fi.RequiredField("Zone")
		}
		if expected.CommercialType == nil {
			return fi.RequiredField("CommercialType")
		}
		if expected.Image == nil {
			return fi.RequiredField("Image")
		}
	}
	return nil
}

func (_ *Instance) RenderScw(t *scaleway.ScwAPITarget, actual, expected, changes *Instance) error {
	instanceService := t.Cloud.InstanceService()
	zone := scw.Zone(fi.ValueOf(expected.Zone))

	userData, err := fi.ResourceAsBytes(*expected.UserData)
	if err != nil {
		return fmt.Errorf("error rendering instances: %w", err)
	}

	newInstanceCount := expected.Count
	if actual != nil {

		// Add "kops.k8s.io/needs-update" label to servers needing update
		for _, serverID := range actual.NeedsUpdate {
			server, err := instanceService.GetServer(&instance.GetServerRequest{
				Zone:     zone,
				ServerID: serverID,
			})
			if err != nil {
				return fmt.Errorf("rendering server group: listing existing servers: %w", err)
			}
			_, err = instanceService.UpdateServer(&instance.UpdateServerRequest{
				Zone:     zone,
				ServerID: serverID,
				Tags:     scw.StringsPtr(append(server.Server.Tags, scaleway.TagNeedsUpdate)),

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check that the UserData resource (cloud-init template) is well-formed and readable
  2. Look at the wrapped error for the exact resource failure
  3. Re-run after fixing the template or its references
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/scalewaytasks/instance.go:183 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/454feebc16f56c2c. Report an issue: GitHub.