{"record":{"id":"8351401674bfa27e","repo":"kubernetes/kops","slug":"invalid-value-for-v-v","errorCode":null,"errorMessage":"Invalid value for %v: %v","messagePattern":"Invalid value for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/instance.go","lineNumber":447,"sourceCode":"\n\ti, err := t.Cloud.GetImage(fi.ValueOf(e.Image))\n\tif err != nil {\n\t\treturn servers.CreateOpts{}, fmt.Errorf(\"Error getting image information: %v\", err)\n\t}\n\n\tblockDevice := servers.BlockDevice{\n\t\tBootIndex:           0,\n\t\tDeleteOnTermination: true,\n\t\tDestinationType:     \"volume\",\n\t\tSourceType:          \"image\",\n\t\tUUID:                i.ID,\n\t\tVolumeSize:          i.MinDiskGigabytes,\n\t}\n\n\tif s, ok := e.Metadata[openstack.BOOT_VOLUME_SIZE]; ok {\n\t\ti, err := strconv.ParseInt(s, 10, 64)\n\t\tif err != nil {\n\t\t\treturn servers.CreateOpts{}, fmt.Errorf(\"Invalid value for %v: %v\", openstack.BOOT_VOLUME_SIZE, err)\n\t\t}\n\n\t\tblockDevice.VolumeSize = int(i)\n\t}\n\n\topts.BlockDevice = []servers.BlockDevice{blockDevice}\n\treturn opts, nil\n}\n\nfunc bootFromVolume(m map[string]string) bool {\n\tv, ok := m[openstack.BOOT_FROM_VOLUME]\n\tif !ok {\n\t\treturn false\n\t}\n\n\tswitch v {\n\tcase \"true\", \"enabled\":\n\t\treturn true","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/instance.go#L429-L465","documentation":"Thrown by includeBootVolumeOptions when the metadata key openstack.BOOT_VOLUME_SIZE (kops.openstack.org/boot-volume-size) cannot be parsed by strconv.ParseInt(s, 10, 64). This is a pure client-side validation error before any Nova call — the metadata value must be a base-10 integer representing the boot volume size in GB. The wrapped strconv.NumError is included in the message.","triggerScenarios":"Instance metadata contains a non-numeric boot-volume-size value, e.g. \"50GB\", \"50Gi\", \"0x32\", \"50.0\", or an empty string; set via cluster spec openstack metadata or blockStore config. Parse fails with `strconv.ParseInt: parsing \"...\": invalid syntax` (or value out of range for int64).","commonSituations":"User wrote \"50GB\" or \"50 GiB\" instead of plain \"50\"; value copied from Terraform-style config that allows units; shell interpolation produced an empty string; decimal size like \"12.5\"; value set programmatically as a formatted number with thousands separator.","solutions":["Set BOOT_VOLUME_SIZE metadata to a plain base-10 integer of gigabytes, e.g. \"50\" instead of \"50GB\"","Verify what was actually set: inspect the instance task metadata in the cluster spec / `kops toolbox template` output and fix the value","If a unit is desired, convert manually (50GB → 50) — the code does no unit parsing","Rerun `kops update cluster` after correcting; also fix any automation (scripts/Helm values) generating the metadata"],"exampleFix":"// before (cluster spec metadata)\nkops.k8s.io/boot-volume-size: \"100GB\"\n// after\nkops.k8s.io/boot-volume-size: \"100\"","handlingStrategy":"validation","validationCode":"// validate BOOT_VOLUME_SIZE metadata is a plain base-10 integer before apply\nfunc validateBootVolumeSize(metadata map[string]string) error {\n\ts, ok := metadata[openstack.BOOT_VOLUME_SIZE]\n\tif !ok {\n\t\treturn nil\n\t}\n\tif _, err := strconv.ParseInt(s, 10, 64); err != nil {\n\t\treturn fmt.Errorf(\"%s must be a plain integer of GB, got %q: %w\", openstack.BOOT_VOLUME_SIZE, s, err)\n\t}\n\treturn nil\n}","typeGuard":"func isBootVolumeSizeValid(metadata map[string]string) bool {\n\ts, ok := metadata[openstack.BOOT_VOLUME_SIZE]\n\tif !ok {\n\t\treturn true\n\t}\n\t_, err := strconv.ParseInt(s, 10, 64)\n\treturn err == nil\n}","tryCatchPattern":null,"preventionTips":["Always specify boot volume size as bare GB integers (\"100\"), never \"100GB\" or \"100 GiB\"","Lint cluster templates to check the metadata value parses as an int before apply","Avoid shell/templated values that may render empty strings into metadata","Ensure generated specs don't carry decimal or thousands-separated numbers","Document the expected format where team members copy cluster specs"],"tags":["openstack","validation","boot-from-volume","metadata","kops"],"backgroundTag":"invalid-metadata-value","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"}