{"record":{"id":"7ef4b635ce67eba6","repo":"kubernetes/kops","slug":"error-setting-tags-to-unknown-volume","errorCode":null,"errorMessage":"error setting tags to unknown volume","messagePattern":"error setting tags to unknown volume","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/volume.go","lineNumber":114,"sourceCode":"\tif !done {\n\t\tif err == nil {\n\t\t\terr = wait.ErrWaitTimeout\n\t\t}\n\t\treturn attachment, err\n\t}\n\treturn attachment, err\n}\n\nfunc (c *openstackCloud) SetVolumeTags(id string, tags map[string]string) error {\n\treturn setVolumeTags(c, id, tags)\n}\n\nfunc setVolumeTags(c OpenstackCloud, id string, tags map[string]string) error {\n\tif len(tags) == 0 {\n\t\treturn nil\n\t}\n\tif id == \"\" {\n\t\treturn fmt.Errorf(\"error setting tags to unknown volume\")\n\t}\n\tklog.V(4).Infof(\"setting tags to cinder volume %q: %v\", id, tags)\n\n\topt := cinder.UpdateOpts{Metadata: tags}\n\tdone, err := vfs.RetryWithBackoff(writeBackoff, func() (bool, error) {\n\t\t_, err := cinder.Update(context.TODO(), c.BlockStorageClient(), id, opt).Extract()\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"error setting tags to cinder volume %q: %v\", id, err)\n\t\t}\n\t\treturn true, nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t} else if done {\n\t\treturn nil\n\t} else {\n\t\treturn wait.ErrWaitTimeout\n\t}","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/volume.go#L96-L132","documentation":"SetVolumeTags was called with an empty volume ID but a non-empty tags map. It is a defensive guard against programming errors where the caller lost track of which volume to tag; the request is rejected before hitting the API.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/openstack/volume.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Trace the caller: the volume ID was never populated (volume creation may have failed earlier)","Ensure volume creation succeeded and its ID is propagated before tagging"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}