{"record":{"id":"4f3abcf6c85e8e52","repo":"kubernetes/kops","slug":"updating-volume-s-s-w","errorCode":null,"errorMessage":"updating volume %s (%s): %w","messagePattern":"updating volume (.+?) \\((.+?)\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/volume.go","lineNumber":119,"sourceCode":"\t\t}\n\t}\n\treturn nil\n}\n\nfunc (_ *Volume) RenderScw(t *scaleway.ScwAPITarget, actual, expected, changes *Volume) error {\n\tinstanceService := t.Cloud.InstanceService()\n\tzone := scw.Zone(fi.ValueOf(expected.Zone))\n\n\tif actual != nil {\n\t\t_, err := instanceService.UpdateVolume(&instance.UpdateVolumeRequest{\n\t\t\tZone:     zone,\n\t\t\tVolumeID: fi.ValueOf(actual.ID),\n\t\t\tName:     expected.Name,\n\t\t\tTags:     new(expected.Tags),\n\t\t\tSize:     scw.SizePtr(scw.Size(fi.ValueOf(expected.Size))),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"updating volume %s (%s): %w\", *actual.Name, *actual.ID, err)\n\t\t}\n\n\t} else {\n\t\t_, err := instanceService.CreateVolume(&instance.CreateVolumeRequest{\n\t\t\tZone:       zone,\n\t\t\tName:       fi.ValueOf(expected.Name),\n\t\t\tVolumeType: instance.VolumeVolumeType(fi.ValueOf(expected.Type)),\n\t\t\tSize:       scw.SizePtr(scw.Size(fi.ValueOf(expected.Size))),\n\t\t\tTags:       expected.Tags,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"rendering volume: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/volume.go#L101-L137","documentation":"kOps wraps errors from the Scaleway instance API when updating an existing volume in the volume task's RenderScw. The wrapped error comes from scaleway-sdk-go's instanceService.UpdateVolume call, so it means the API rejected the update (wrong volume ID, state conflict, or API/auth failure). kOps preserves the volume name and ID for identification.","triggerScenarios":"RenderScw runs during `kops update cluster` on a Scaleway cluster; the volume exists (actual.VolumeID matches), the update diff is non-empty (name/tags/size changed), and instanceService.UpdateVolume returns an error — e.g. volume attached and size shrink attempted, deleted volume, or SDK/network failure.","commonSituations":"Shrinking a root/data volume (Scaleway volumes cannot be shrunk); volume deleted out-of-band in the Scaleway console; expired or missing Scaleway credentials; transient Scaleway API outage; changing volume type in place which the API rejects.","solutions":["Check the wrapped SDK error: if it says the volume cannot be shrunk, only increase the volume size in the cluster spec, never decrease.","Verify the volume still exists in the Scaleway console in the same zone as the cluster; re-add it or re-run `kops update cluster` if it was deleted out-of-band.","Confirm SCALEWAY_ACCESS_KEY/SECRET_KEY/PROJECT credentials are valid and have Instance API permissions.","Retry the update if the wrapped error indicates a transient 429/5xx Scaleway API failure."],"exampleFix":"// before: shrinking volume in cluster spec\nvolumeSize: 100\nvolumeSize: 50\n// after: keep or grow the size (shrink is unsupported)\nvolumeSize: 100","handlingStrategy":"validation","validationCode":"// before applying, ensure the volume change is legal\nif desired.Size != nil && actual.Size != nil && *desired.Size < *actual.Size {\n    return fmt.Errorf(\"volume %s cannot shrink from %d to %d GB\", *actual.Name, *actual.Size, *desired.Size)\n}\n// also confirm the volume still exists via the Scaleway API before updating","typeGuard":null,"tryCatchPattern":"if err != nil {\n    var apiErr *sdk.Error\n    if errors.As(err, &apiErr) && apiErr.StatusCode == 429 {\n        // backoff and retry the update\n    }\n    return fmt.Errorf(\"updating volume %s (%s): %w\", name, id, err)\n}","preventionTips":["Never decrease volume sizes in the cluster spec","Verify volume existence/zone before diffing","Keep Scaleway credentials scoped and rotated","Wrap updates in retry with backoff for 429/5xx"],"tags":["scaleway","storage","cloud-api"],"backgroundTag":"cloud-api-update-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}