{"record":{"id":"0d078c5903b7d3a0","repo":"Billionmail/BillionMail","slug":"dns-provider-initialization-failed","errorCode":null,"errorMessage":"DNS provider initialization failed: {}","messagePattern":"DNS provider initialization failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/acme.go","lineNumber":140,"sourceCode":"\n/**\n * @description: Configure DNS verification via Tencent Cloud\n * @param {*lego.Client} client Client\n * @param {map[string]string} keyConfig Configuration information\n * @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\"))","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/acme.go#L122-L158","documentation":"After loading SecretId/SecretKey into a tencentcloud.NewDefaultConfig, SetDnsTencentcloud calls tencentcloud.NewDNSProviderConfig(cfg) to build the lego DNS provider. If lego's Tencent Cloud provider rejects the config (bad credential format, unsupported options), the constructor returns an error which is wrapped in this message.","triggerScenarios":"tencentcloud.NewDNSProviderConfig(cfg) returns non-nil err in SetDnsTencentcloud (acme.go:139-142), typically when the provided credentials are malformed or the SDK cannot initialize the provider.","commonSituations":"SecretId/SecretKey contain whitespace or invalid characters; copy-paste truncated the key; lego version where the tencentcloud provider changed its config requirements; placeholder credentials ('xxx') saved in the panel.","solutions":["Inspect the wrapped err text in the message to see the underlying provider failure.","Re-enter Tencent Cloud SecretId/SecretKey, trimming whitespace and confirming the full key.","Test the credentials against the Tencent Cloud DNS API (e.g. via the console or SDK) to confirm validity.","Update the lego dependency to a version compatible with the current provider config."],"exampleFix":"// before\ncfg.SecretID = strings.TrimSpace(\" AKID... \") // kept stray spaces\n// after\ncfg.SecretID = strings.TrimSpace(keyConfig[\"SecretId\"])\ncfg.SecretKey = strings.TrimSpace(keyConfig[\"SecretKey\"])","handlingStrategy":"try-catch","validationCode":"if m != nil && m[\"SecretId\"] != \"\" && m[\"SecretKey\"] != \"\" {\n    // safe to attempt provider construction\n}","typeGuard":"func hasTencentKeys(m map[string]string) bool {\n    return m != nil && m[\"SecretId\"] != \"\" && m[\"SecretKey\"] != \"\"\n}","tryCatchPattern":"p, err := tencentcloud.NewDNSProviderConfig(cfg)\nif err != nil {\n    log.Printf(\"tencentcloud DNS provider init failed: %v\", err)\n    return fmt.Errorf(\"invalid TencentCloud credentials: %w\", err)\n}","preventionTips":["Always log the wrapped err to capture lego's root cause.","Trim whitespace from copied credentials.","Test credentials with a lightweight Tencent Cloud API call before issuing certificates.","Keep the lego dependency up to date and tested after upgrades."],"tags":["dns","acme","tencentcloud","provider-init","config"],"backgroundTag":"dns-provider-init-failed","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}