{"record":{"id":"1590376886c40365","repo":"kubernetes/kops","slug":"empty-resource-group-name","errorCode":null,"errorMessage":"empty resource group name","messagePattern":"empty resource group name","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/verifier.go","lineNumber":299,"sourceCode":"\n// client is an Azure client.\ntype client struct {\n\tsubscriptionID string\n\tresourceGroup  string\n\tnisClient      *network.InterfacesClient\n\tvmsClient      *compute.VirtualMachinesClient\n\tvmssVMsClient  *compute.VirtualMachineScaleSetVMsClient\n}\n\n// newVerifierClient builds Azure API clients scoped to the local instance's subscription and\n// resource group from IMDS metadata.\nfunc newVerifierClient(ctx context.Context) (*client, error) {\n\tmetadata, err := azuremetadata.QueryComputeInstanceMetadata(ctx)\n\tif err != nil || metadata == nil {\n\t\treturn nil, fmt.Errorf(\"getting instance metadata: %w\", err)\n\t}\n\tif metadata.ResourceGroupName == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty resource group name\")\n\t}\n\tif metadata.SubscriptionID == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty subscription ID\")\n\t}\n\tklog.V(4).Infof(\"Azure verifier client using subscription %q resource group %q\", metadata.SubscriptionID, metadata.ResourceGroupName)\n\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating an identity: %w\", err)\n\t}\n\n\tnisClient, err := network.NewInterfacesClient(metadata.SubscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating interfaces client: %w\", err)\n\t}\n\tvmsClient, err := compute.NewVirtualMachinesClient(metadata.SubscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating VMs client: %w\", err)","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/verifier.go#L281-L317","documentation":"The IMDS compute metadata was retrieved but the ResourceGroupName field is empty. The verifier requires a resource group to scope its Network Interfaces and Virtual Machines clients, so it refuses to continue.","triggerScenarios":"QueryComputeInstanceMetadata succeeded but metadata.ResourceGroupName == \"\" — e.g. a non-VM context, a mocked/legacy metadata source, or metadata response lacking compute.resourceGroupName.","commonSituations":"Running the verifier binary off-cluster/off-Azure against a fake metadata endpoint; very old IMDS API versions that omit resourceGroupName; metadata service proxied to a generic response; typo in environment forcing an alternate metadata source.","solutions":["Check IMDS output contains resourceGroupName: curl -H Metadata:true 'http://169.254.169.254/metadata/instance/compute?api-version=2021-02-01' | jq .resourceGroupName","Ensure the VM is a real Azure resource manager VM (not classic), which always populates resourceGroupName","Remove any IMDS proxy/override in the environment so real Azure metadata is returned","Recreate the node via kops if the VM was built with an unusual/unsupported image configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"m, err := azuremetadata.QueryComputeInstanceMetadata(ctx)\nif err == nil && m != nil && m.ResourceGroupName == \"\" {\n\treturn fmt.Errorf(\"IMDS returned empty resourceGroupName; not running on a managed Azure VM?\")\n}","typeGuard":null,"tryCatchPattern":"_, err := newVerifierClient(ctx)\nif err != nil && strings.Contains(err.Error(), \"empty resource group name\") {\n\t// abort: wrong environment; don't retry blindly\n}","preventionTips":["Run the verifier only on kops-created Azure VMs","Remove IMDS proxies/stubs from production node images","Validate IMDS fields at node bootstrap and fail fast","Avoid classic (non-ARM) VMs"],"tags":["azure","imds","metadata","config"],"backgroundTag":"empty-resource-group","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"}