{"record":{"id":"6daec5bcb521f75e","repo":"kubernetes/kops","slug":"s-is-not-a-valid-metadata-search-order-option-su","errorCode":null,"errorMessage":"%s is not a valid metadata search order option. Supported options are %s and %s","messagePattern":"(.+?) is not a valid metadata search order option\\. Supported options are (.+?) and (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/openstackmetadata/metadata.go","lineNumber":189,"sourceCode":"// Depending on the searchOrder it will return data from the first source which successfully returns.\n// If all the sources in searchOrder are erroneous it will propagate the last error to its caller.\nfunc (mds MetadataService) getMetadata() (*InstanceMetadata, error) {\n\t// Note(ederst): I used and modified code for getting the config drive metadata to work from here:\n\t//   * https://github.com/kubernetes/cloud-provider-openstack/blob/27b6fc483451b6df2112a6a4a40a34ffc9093635/pkg/util/metadata/metadata.go\n\n\tvar meta *InstanceMetadata\n\tvar err error\n\n\tids := strings.Split(mds.searchOrder, \",\")\n\tfor _, id := range ids {\n\t\tid = strings.TrimSpace(id)\n\t\tswitch id {\n\t\tcase ConfigDriveID:\n\t\t\tmeta, err = mds.getFromConfigDrive()\n\t\tcase MetadataID:\n\t\t\tmeta, err = mds.getFromMetadataService()\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"%s is not a valid metadata search order option. Supported options are %s and %s\", id, ConfigDriveID, MetadataID)\n\t\t}\n\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn meta, err\n}\n\n// getDefaultMounter returns a mount and executor interface to use for getting metadata from a config drive\nfunc getDefaultMounter() *mount.SafeFormatAndMount {\n\tmounter := mount.New(\"\")\n\texec := utilexec.New()\n\treturn &mount.SafeFormatAndMount{\n\t\tInterface: mounter,\n\t\tExec:      exec,\n\t}","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/openstackmetadata/metadata.go#L171-L207","documentation":"getMetadata iterates a configured search order of metadata sources. If an entry is neither ConfigDriveID nor MetadataID, it records this error listing the two supported options (upup/pkg/fi/cloudup/openstack/openstackmetadata/metadata.go:189). It is purely a configuration-validation error.","triggerScenarios":"The metadata search-order configuration contains a string other than \"configDrive\" or \"metadataService\" — a typo (e.g. \"metadata\"), wrong casing, or a stale option name in cluster spec / environment config.","commonSituations":"Hand-edited cluster spec setting an invalid --openstack-metadata-search-order value; documentation drift after the option names changed between kOps versions; YAML typos in the cluster configuration.","solutions":["Set the search order to exactly \"configDrive\" and/or \"metadataService\" (match the ConfigDriveID/MetadataID constants).","Check kOps docs for the current valid values of the OpenStack metadata search order option for your kOps version.","Validate the cluster spec (kops replace/update output) before applying to catch the typo early.","If migrating from an older version, update any deprecated option names to the current constants."],"exampleFix":"// before\nmetadataSearchOrder: \"metadata, configdrive\"\n// after\nmetadataSearchOrder: \"configDrive, metadataService\"","handlingStrategy":"validation","validationCode":"// Validate the configured search order against the supported options\nvar valid = map[string]bool{\"configDrive\": true, \"metadataService\": true}\nfor _, id := range searchOrder {\n    if !valid[id] {\n        return fmt.Errorf(\"%q is invalid; supported options are configDrive and metadataService\", id)\n    }\n}","typeGuard":null,"tryCatchPattern":"meta, err := mds.getMetadata()\nif err != nil {\n    if strings.Contains(err.Error(), \"not a valid metadata search order option\") {\n        // fix configuration to only use 'configDrive' and 'metadataService', then retry\n    }\n    return nil, err\n}","preventionTips":["Only use the exact strings \"configDrive\" and \"metadataService\" in search-order configuration.","Copy option values from the version's documentation/constants, not from memory or older docs.","Run kops cluster spec validation before applying changes.","Watch for option renames when upgrading kOps versions."],"tags":["openstack","configuration","metadata","validation"],"backgroundTag":"invalid-config-option","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"}