{"record":{"id":"f214661473ebe345","repo":"Billionmail/BillionMail","slug":"dns-provider-is-required-for-dns-verification","errorCode":null,"errorMessage":"DNS provider is required for DNS verification","messagePattern":"DNS provider is required for DNS verification","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/cli.go","lineNumber":102,"sourceCode":"\t// Check email\n\tif cli.Email == \"\" {\n\t\treturn fmt.Errorf(\"email is required\")\n\t}\n\n\t// Check domains\n\tif len(cli.Domains) == 0 {\n\t\treturn fmt.Errorf(\"at least one domain is required\")\n\t}\n\n\t// Check verification type\n\tif cli.VerifyType != \"http\" && cli.VerifyType != \"dns\" {\n\t\treturn fmt.Errorf(\"verification type must be either 'http' or 'dns'\")\n\t}\n\n\t// Check DNS provider if using DNS verification\n\tif cli.VerifyType == \"dns\" {\n\t\tif cli.DnsProvider == \"\" {\n\t\t\treturn fmt.Errorf(\"DNS provider is required for DNS verification\")\n\t\t}\n\n\t\t// Check if DNS provider is supported\n\t\tsupportedProviders := []string{\"tencentcloud\", \"alidns\", \"cloudxns\", \"azuredns\", \"cloudflare\", \"godaddy\"}\n\t\tisSupported := false\n\t\tfor _, provider := range supportedProviders {\n\t\t\tif cli.DnsProvider == provider {\n\t\t\t\tisSupported = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !isSupported {\n\t\t\treturn fmt.Errorf(\"unsupported DNS provider: %s, supported providers: %s\",\n\t\t\t\tcli.DnsProvider, strings.Join(supportedProviders, \", \"))\n\t\t}\n\n\t\t// Check DNS config","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/cli.go#L84-L120","documentation":"Parameter check in AcmeCLI.Validate: VerifyType was set to \"dns\" but DnsProvider is empty. DNS-01 verification needs a DNS API provider to create the challenge TXT record, so validation fails before the acme.sh DNS hook is selected.","triggerScenarios":"Calling Validate/Apply with VerifyType=\"dns\" but DnsProvider left unset (missing --dns-provider flag or empty config key).","commonSituations":"Switching from http to dns verification without updating the invocation; template-based automation where the provider field is only filled for some environments.","solutions":["Set cli.DnsProvider to one of the supported providers (e.g. cloudflare, alidns, tencentcloud)","Pass --dns-provider <name> alongside --verify-type dns","Skip requiring a provider when VerifyType is http"],"exampleFix":"// before\ncli := &AcmeCLI{Email: e, Domains: d, VerifyType: \"dns\"} // provider missing\n// after\ncli := &AcmeCLI{Email: e, Domains: d, VerifyType: \"dns\", DnsProvider: \"cloudflare\", DnsConfig: cfg}","handlingStrategy":"validation","validationCode":"if strings.EqualFold(cli.VerifyType, \"dns\") && strings.TrimSpace(cli.DnsProvider) == \"\" {\n    return errors.New(\"--dns-provider must be set when verify-type is dns\")\n}","typeGuard":null,"tryCatchPattern":"if err := cli.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"DNS provider is required\") {\n        log.Printf(\"--dns-provider missing for dns verification of %v\", cli.Domains)\n    }\n    os.Exit(1)\n}","preventionTips":["Set DnsProvider in the same config block as VerifyType so they stay in sync","When switching verify type http->dns, update provider + credentials together","Validate config at startup, before scheduling issuance","Document the required provider value per environment"],"tags":["validation","acme","dns"],"backgroundTag":"missing-required-argument","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}