kubernetes/kops · error
error writing additional objects: %v
Error message
error writing additional objects: %v
What it means
RunCreate wraps any error returned by the addons clientset's Replace call (which persists the addon objects in the cluster's state store) with 'error writing additional objects'. It means one or more of the user-supplied addon/additional objects could not be written to the backing store. The wrapped error from addonsClient.Replace is preserved as %v.
Source
Thrown at cmd/kops/create.go:229
}
}
}
// Because not all addons support labels, we can only support one cluster here.
// A single cluster per create is probably a good idea anyway.
if len(addons) != 0 {
if len(clusters) > 1 {
return fmt.Errorf("cannot specify additional objects when multiple clusters are created")
}
if len(clusters) == 0 {
return fmt.Errorf("must specify a cluster when creating additional objects")
}
cluster := clusters[0]
addonsClient := clientset.AddonsFor(cluster)
if err := addonsClient.Replace(addons); err != nil {
return fmt.Errorf("error writing additional objects: %v", err)
}
}
{
// If there is a value in this sb, this should mean that we have something to deploy
// so let's advise the user how to engage the cloud provider and deploy
if sb.String() != "" {
fmt.Fprintf(&sb, "\n")
fmt.Fprintf(&sb, "To deploy these resources, run: kops update cluster --name %s --yes\n", clusterName)
fmt.Fprintf(&sb, "\n")
}
_, err := out.Write(sb.Bytes())
if err != nil {
return fmt.Errorf("error writing to output: %v", err)
}
}
return nil
}View on GitHub (pinned to 4c8573c808)
Solutions
- Read the wrapped %v error for the root cause and fix the underlying state-store access or object validity issue
- Verify the --state flag / KOPS_STATE_STORE env var points to a writable bucket with valid credentials
- Validate the addon YAML (kops create --dry-run) before applying
- Retry the kops create command after resolving storage issues
Example fix
// before
if err := addonsClient.Replace(addons); err != nil {
return fmt.Errorf("error writing additional objects: %v", err)
}
// after
// no code fix needed; fix state store access/creds so Replace succeeds Defensive patterns
Strategy: try-catch
Validate before calling
// verify state store access before create
if os.Getenv("KOPS_STATE_STORE") == "" {
return fmt.Errorf("KOPS_STATE_STORE must be set")
}
// ensure credentials can write, e.g. aws s3 ls s3://$KOPS_STATE_STORE Try / catch
err := addonsClient.Replace(addons)
if err != nil {
var e *StorageError
if errors.As(err, &e) {
// fix state store creds/access, then retry
}
return fmt.Errorf("error writing additional objects: %w", err)
} Prevention
- Always set and verify KOPS_STATE_STORE / --state before create
- Pre-validate manifests with kops create --dry-run
- Confirm cloud credentials have write access to the state bucket
- Keep addons YAML schema-current with your kops version
When it happens
Trigger: Running `kops create -f` (or piping YAML) where the manifest contains addons; the AddonsFor(cluster).Replace() write to the state store fails — typically a state-store connection/permission problem or an invalid addon object rejected by the API.
Common situations: S3/GCS/OSS state store bucket misconfigured or unreachable; insufficient IAM credentials to write cluster state; malformed addon YAML that fails server-side validation.
Related errors
- building menu for %q: %w
- applying %q: %w
- error creating cluster: %v
- error querying cluster %q: %v
- cannot specify additional objects when multiple clusters are
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/6d97b260477a900c.
Report an issue: GitHub.