{"record":{"id":"5c9b848e017f76e4","repo":"Billionmail/BillionMail","slug":"dns-verification-setup-failed","errorCode":null,"errorMessage":"DNS verification setup failed: {}","messagePattern":"DNS verification setup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/acme.go","lineNumber":145,"sourceCode":" * @return error Error information\n */\nfunc SetDnsTencentcloud(ctx context.Context, client *lego.Client, keyConfig map[string]string) error {\n\tif keyConfig == nil || keyConfig[\"SecretId\"] == \"\" || keyConfig[\"SecretKey\"] == \"\" {\n\t\treturn errors.New(public.LangCtx(ctx, \"DNS automated resolution failed: SecretId or SecretKey is empty in TencentCloud configuration file\"))\n\t}\n\n\tcfg := tencentcloud.NewDefaultConfig()\n\tcfg.SecretID = keyConfig[\"SecretId\"]\n\tcfg.SecretKey = keyConfig[\"SecretKey\"]\n\n\tp, err := tencentcloud.NewDNSProviderConfig(cfg)\n\tif err != nil {\n\t\treturn errors.New(public.LangCtx(ctx, \"DNS provider initialization failed: {}\", err.Error()))\n\t}\n\n\terr = client.Challenge.SetDNS01Provider(p)\n\tif err != nil {\n\t\treturn errors.New(public.LangCtx(ctx, \"DNS verification setup failed: {}\", err.Error()))\n\t}\n\treturn nil\n}\n\n/**\n * @description: Configure DNS verification via Alibaba Cloud\n * @param {*lego.Client} client Client\n * @param {map[string]string} keyConfig Configuration information\n * @return error Error information\n */\nfunc SetDnsAliyun(ctx context.Context, client *lego.Client, keyConfig map[string]string) error {\n\tif keyConfig == nil || keyConfig[\"APIKey\"] == \"\" || keyConfig[\"SecretKey\"] == \"\" {\n\t\treturn errors.New(public.LangCtx(ctx, \"DNS automated resolution failed: APIKey or SecretKey is empty in AliDNS configuration file\"))\n\t}\n\n\tcfg := alidns.NewDefaultConfig()\n\tcfg.APIKey = keyConfig[\"APIKey\"]\n\tcfg.SecretKey = keyConfig[\"SecretKey\"]","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/acme.go#L127-L163","documentation":"Once the Tencent Cloud provider is built, SetDnsTencentcloud registers it for the DNS-01 challenge via client.Challenge.SetDNS01Provider(p). lego returns an error if the provider is unsuitable for DNS-01 (e.g. no propagation/timeout options accepted, nil provider, or internal registration failure); the code wraps it in this message.","triggerScenarios":"client.Challenge.SetDNS01Provider(p) returns non-nil err in SetDnsTencentcloud (acme.go:144-147) after a successful provider construction.","commonSituations":"lego client was created without the DNS-01 challenge enabled; a nil or misconfigured provider slipped through; lego version mismatch between client and provider packages; custom propagation options rejected by lego.","solutions":["Read the wrapped err text to identify why lego rejected the DNS-01 provider.","Ensure the lego.Client was initialized normally (lego.NewClient with a valid ACME user) before setting the challenge.","Rebuild the provider with default propagation/timeout settings to rule out invalid options.","Align lego package versions in go.mod so client and provider come from the same module version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if client == nil || p == nil {\n    return errors.New(\"lego client and DNS provider must be non-nil before SetDNS01Provider\")\n}","typeGuard":null,"tryCatchPattern":"err := client.Challenge.SetDNS01Provider(p)\nif err != nil {\n    log.Printf(\"DNS-01 provider registration failed: %v\", err)\n    return fmt.Errorf(\"DNS-01 challenge setup failed: %w\", err)\n}","preventionTips":["Create the lego client with a valid ACME user before challenge setup.","Keep lego client and provider packages on the same version.","Use default propagation/timeout options unless validated otherwise.","Add an integration test that sets the DNS-01 provider for each supported provider."],"tags":["dns","acme","dns01","challenge","lego"],"backgroundTag":"dns01-challenge-setup-failed","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"}