{"record":{"id":"f9b3ae1315d19ff6","repo":"kubernetes/kops","slug":"could-not-init-dns-provider-q-v","errorCode":null,"errorMessage":"could not init DNS provider %q: %v","messagePattern":"could not init DNS provider %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dnsprovider/pkg/dnsprovider/plugins.go","lineNumber":102,"sourceCode":"\t}\n\n\tif configFilePath != \"\" {\n\t\tvar config *os.File\n\t\tconfig, err = os.Open(configFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"couldn't open DNS provider configuration %s: %#v\", configFilePath, err)\n\t\t}\n\n\t\tdefer config.Close()\n\t\tdns, err = GetDnsProvider(name, config)\n\t} else {\n\t\t// Pass explicit nil so plugins can actually check for nil. See\n\t\t// \"Why is my nil error value not equal to nil?\" in golang.org/doc/faq.\n\t\tdns, err = GetDnsProvider(name, nil)\n\t}\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not init DNS provider %q: %v\", name, err)\n\t}\n\tif dns == nil {\n\t\treturn nil, fmt.Errorf(\"unknown DNS provider %q\", name)\n\t}\n\n\treturn dns, nil\n}\n","sourceCodeStart":84,"sourceCodeEnd":110,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/dnsprovider/pkg/dnsprovider/plugins.go#L84-L110","documentation":"dnsprovider.InitDnsProvider wraps any error from GetDnsProvider(name, config|nil) as \"could not init DNS provider %q: %v\". GetDnsProvider loads the provider plugin/driver by name and constructs the provider from the given configuration; failure means the provider name is unrecognized by registered plugins or the provider rejected the configuration. This is the terminal init error for the DNS provider subsystem.","triggerScenarios":"Calling InitDnsProvider with a provider name that has no registered dnsprovider plugin (e.g. misspelled --dns flag), or where the provider's constructor fails parsing/validating the supplied config reader; the wrapped error carries the provider-specific cause.","commonSituations":"Unsupported or misspelled --dns value (e.g. 'route53' instead of 'aws-route53'); provider plugin not registered/linked into the binary; malformed provider configuration; cloud SDK auth setup rejected during provider construction.","solutions":["Check the provider name against supported values (aws-route53, google-clouddns, coredns, etc.) and fix the --dns flag.","Read the wrapped '%v' error for the provider-specific cause (bad config vs unknown name).","If the provider is a plugin, ensure it is registered/compiled into the binary you are running.","Validate the configuration file contents against the provider's expected schema."],"exampleFix":"// before: unknown provider name\nprovider, err := dnsprovider.InitDnsProvider(\"route53\", \"\")\n// after: registered provider name\nprovider, err := dnsprovider.InitDnsProvider(\"aws-route53\", \"\")","handlingStrategy":"fallback","validationCode":"// Go: check the provider name against the supported set before init\nvar validProviders = map[string]bool{\"aws-route53\": true, \"google-clouddns\": true, \"coredns\": true, \"gossip\": true}\nif !validProviders[name] {\n    return fmt.Errorf(\"unsupported --dns provider %q\", name)\n}","typeGuard":null,"tryCatchPattern":"provider, err := dnsprovider.InitDnsProvider(name, path)\nif err != nil {\n    klog.Errorf(\"DNS provider init failed: %v\", err)\n    if strings.Contains(err.Error(), \"unknown DNS provider\") {\n        // fall back to a known-good provider, e.g. gossip for local dev\n        provider, err = dnsprovider.InitDnsProvider(\"gossip\", \"\")\n    }\n}","preventionTips":["Use the exact provider names kops registers (aws-route53, google-clouddns, etc.).","Pin the provider configuration schema to the kops version you deploy.","Fail fast in CI by running a provider init smoke test before rollout."],"tags":["dns-provider","configuration","plugin"],"backgroundTag":"dns-provider-init-failed","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"}