kubernetes/kops · error
error reading created Disk: %v
Error message
error reading created Disk: %v
What it means
After creating (or confirming) the disk, RenderGCE reads the disk back with Disks().Get to fetch its label fingerprint; this error wraps any failure of that read. It indicates the disk could not be fetched immediately after its creation flow.
Source
Thrown at upup/pkg/fi/cloudup/gcetasks/disk.go:146
if e.VolumeThroughput != nil {
disk.ProvisionedThroughput = *e.VolumeThroughput
}
if a == nil {
op, err := cloud.Compute().Disks().Insert(t.Cloud.Project(), *e.Zone, disk)
if err != nil {
return fmt.Errorf("error creating Disk: %v", err)
}
err = cloud.WaitForOp(op)
if err != nil {
return fmt.Errorf("error during Disk creation: %v", err)
}
}
if changes.Labels != nil {
d, err := cloud.Compute().Disks().Get(t.Cloud.Project(), *e.Zone, disk.Name)
if err != nil {
return fmt.Errorf("error reading created Disk: %v", err)
}
labelsRequest := &compute.ZoneSetLabelsRequest{
LabelFingerprint: d.LabelFingerprint,
Labels: make(map[string]string),
}
// Danger: labels replace tags on instances; but thankfully volumes don't have tags
//for _, k := range d.Tags {
// labelsRequest.Labels[k] = ""
//}
maps.Copy(labelsRequest.Labels, d.Labels)
maps.Copy(labelsRequest.Labels, t.Cloud.Labels())
maps.Copy(labelsRequest.Labels, e.Labels)
klog.V(2).Infof("Setting labels on disk %q: %v", disk.Name, labelsRequest.Labels)
if err = t.Cloud.Compute().Disks().SetLabels(t.Cloud.Project(), *e.Zone, disk.Name, labelsRequest); err != nil {
return fmt.Errorf("error setting labels on created Disk: %v", err)
}
changes.Labels = nilView on GitHub (pinned to 4c8573c808)
Solutions
- Check the wrapped error: if notFound, verify the Insert operation truly succeeded
- Retry kops update — Get is often transiently failing right after creation
- Verify service account has compute.disks.get permission on the project
- Confirm project and zone in the cluster config match where the disk was created
Defensive patterns
Strategy: try-catch
Validate before calling
// ensure IAM: test compute.disks.get before applying _, err := computeService.Disks.Get(project, zone, diskName).Do()
Try / catch
d, err := cloud.Compute().Disks().Get(project, zone, name)
if err != nil {
if gce.IsNotFound(err) { /* recreate or wait */ }
return fmt.Errorf("read created disk: %w", err)
} Prevention
- Retry Get briefly after creation (eventual visibility)
- Keep service account compute.disks.get permission
- Avoid concurrent kops runs against the same project
When it happens
Trigger: changes.Labels is non-nil and cloud.Compute().Disks().Get(project, zone, disk.Name) returns an error — typically notFound if creation silently failed, or a transient API error.
Common situations: Disk creation operation reported success but the disk is not yet visible; wrong project/zone in cloud config; transient GCP API outage; permission revoked between insert and get.
Related errors
- error during Disk creation: %v
- error setting labels on created Disk: %v
- cannot apply changes to Disk: %v
- getting FirewallRule %q: %w
- creating gce IPAM controller: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/e5ea94bb439886c2.
Report an issue: GitHub.