{"record":{"id":"016466c932b471c5","repo":"kubernetes/kops","slug":"error-creating-port-cloud-opts-v","errorCode":null,"errorMessage":"Error creating port cloud opts: %v","messagePattern":"Error creating port cloud opts: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/port.go","lineNumber":256,"sourceCode":"\t\t}\n\t} else {\n\t\tif changes.Name != nil {\n\t\t\treturn fi.CannotChangeField(\"Name\")\n\t\t}\n\t\tif changes.Network != nil {\n\t\t\treturn fi.CannotChangeField(\"Network\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (*Port) RenderOpenstack(t *openstack.OpenstackAPITarget, a, e, changes *Port) error {\n\tif a == nil {\n\t\tklog.V(2).Infof(\"Creating Port with name: %q\", fi.ValueOf(e.Name))\n\n\t\topt, err := portCreateOptsFromPortTask(t, a, e, changes)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error creating port cloud opts: %v\", err)\n\t\t}\n\n\t\tv, err := t.Cloud.CreatePort(opt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error creating port: %v\", err)\n\t\t}\n\n\t\tif e.Tags != nil {\n\t\t\tfor _, tag := range e.Tags {\n\t\t\t\terr = t.Cloud.AppendTag(openstack.ResourceTypePort, v.ID, tag)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"Error appending tag to port: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\te.ID = new(v.ID)\n\t\tklog.V(2).Infof(\"Creating a new Openstack port, id=%s\", v.ID)\n\t\treturn nil","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/port.go#L238-L274","documentation":"Port.RenderOpenstack wraps failures from portCreateOptsFromPortTask — the function that converts the Port task into Neutron ports.CreateOpts — with this message. It means the task model itself was invalid for translation to a cloud request (e.g. referenced security group or subnet lookup failed inside the opts builder), not that the API call failed.","triggerScenarios":"RenderOpenstack with a==nil (create path) calls portCreateOptsFromPortTask, which returns an error — typically because a named security group listed in e.SecurityGroups could not be found (see portCreateOptsFromPortTask returning 'Additional SecurityGroup not found').","commonSituations":"Cluster spec references additional security groups by name that don't exist in the project; security groups belong to a different project; subnet references unresolvable at render time.","solutions":["Inspect the inner error: it usually names the missing security group","Create the referenced security group in the Openstack project or fix its name in the cluster spec","Verify the security groups exist via `openstack security group list`","Re-run kops once the spec references existing groups"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"for _, sg := range port.SecurityGroups {\n    gs, err := cloud.ListSecurityGroups(securitygroups.ListOpts{Name: sg})\n    if err != nil || len(gs) == 0 {\n        return fmt.Errorf(\"security group %q not found; fix cluster spec before apply\", sg)\n    }\n}","typeGuard":null,"tryCatchPattern":"opt, err := portCreateOptsFromPortTask(t, a, e, changes)\nif err != nil {\n    return fmt.Errorf(\"Error creating port cloud opts: %v\", err)\n} // inspect inner error; usually a missing named security group","preventionTips":["Verify all additional security group names exist in the target project","Keep security group names consistent between cluster spec and cloud","Run a dry-run/preview apply to catch bad references early"],"tags":["openstack","neutron","port"],"backgroundTag":"invalid-resource-reference","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"}