kubernetes/kops · error
error building DNS provider: %w
Error message
error building DNS provider: %w
What it means
scwCloudImplementation.DNS calls dnsprovider.GetDnsProvider with the configured dns.ProviderName and nil config. This error means the kops dnsprovider registry could not build the requested DNS provider — typically because the provider name is not registered or its constructor requires configuration that was not supplied (nil here). It is kOps plumbing around DNS, not a Scaleway API call.
Source
Thrown at upup/pkg/fi/cloudup/scaleway/cloud.go:181
lbAPI: lb.NewZonedAPI(scwClient),
marketplaceAPI: marketplace.NewAPI(scwClient),
}, nil
}
func (s *scwCloudImplementation) ClusterName(tags []string) string {
if tags != nil {
return ClusterNameFromTags(tags)
}
if clusterName, ok := s.tags[TagClusterName]; ok {
return clusterName
}
return ""
}
func (s *scwCloudImplementation) DNS() (dnsprovider.Interface, error) {
provider, err := dnsprovider.GetDnsProvider(dns.ProviderName, nil)
if err != nil {
return nil, fmt.Errorf("error building DNS provider: %w", err)
}
return provider, nil
}
func (s *scwCloudImplementation) ProviderID() kops.CloudProviderID {
return kops.CloudProviderScaleway
}
func (s *scwCloudImplementation) Region() string {
return string(s.region)
}
func (s *scwCloudImplementation) Zone() string {
return string(s.zone)
}
func (s *scwCloudImplementation) DomainService() *domain.API {
return s.domainAPIView on GitHub (pinned to 4c8573c808)
Solutions
- Check the wrapped error to see whether it is 'provider not found' vs a constructor error.
- Ensure dns.ProviderName is a supported value (e.g. 'route53', 'google-clouddns', 'scaleway') and set via KOPS_DNS_PROVIDER correctly.
- Verify the kops binary includes the provider: keep the dnsprovider import (blank-import registry) in the build.
- If the provider needs env vars, export them (e.g. SCW_ACCESS_KEY/SCW_SECRET_KEY) even though config is passed as nil.
Example fix
// before export KOPS_DNS_PROVIDER="" # unknown provider // after export KOPS_DNS_PROVIDER="scaleway"
Defensive patterns
Strategy: try-catch
Validate before calling
if dns.ProviderName == "" {
return fmt.Errorf("KOPS_DNS_PROVIDER is not set; set it to a registered provider")
} Try / catch
provider, err := s.DNS()
if err != nil {
var notFound *dnsprovider.ProviderNotFoundError
if errors.As(err, ¬Found) {
klog.Errorf("DNS provider %q not registered in this kops build; check KOPS_DNS_PROVIDER and build tags", dns.ProviderName)
}
return fmt.Errorf("cluster update aborted, DNS unusable: %w", err)
} Prevention
- Always set KOPS_DNS_PROVIDER explicitly in CI and shell profiles.
- Use an official kops release build that registers all DNS providers.
- Smoke-test DNS provider construction early in provisioning pipelines.
When it happens
Trigger: dnsprovider.GetDnsProvider("scaleway", nil) fails: the provider string is empty/unknown, no DNS provider factory was registered via init() in the built binary, or the provider's constructor returns an error because it cannot read required config (e.g. missing DNS_* env vars).
Common situations: Building kOps with build tags or package imports that exclude the Scaleway DNS provider; KOPS_DNS_PROVIDER unset or misspelled; running a stripped-down kops build that dropped the dnsprovider plugin.
Related errors
- unable to determine IP address for kube-apiserver
- DNS ZoneID not set
- unable to parse Kubernetes cluster API URL: %v
- unable to resolve Kubernetes cluster API URL dns: %v
- error listing DNS ResourceRecords: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/fc9906dcf42484a3.
Report an issue: GitHub.