{"record":{"id":"8ed509a552df3a78","repo":"Billionmail/BillionMail","slug":"dns-automated-resolution-failed-secretid-or-secre","errorCode":null,"errorMessage":"DNS automated resolution failed: SecretId or SecretKey is empty in TencentCloud configuration file","messagePattern":"DNS automated resolution failed: SecretId or SecretKey is empty in TencentCloud configuration file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/acme.go","lineNumber":131,"sourceCode":"\n\t// Set CA directory URL\n\tconfig.CADirURL = \"https://acme-v02.api.letsencrypt.org/directory\"\n\n\t// Set key type\n\tconfig.Certificate.KeyType = certcrypto.RSA2048\n\n\treturn config\n}\n\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","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/acme.go#L113-L149","documentation":"SetDnsTencentcloud configures a lego ACME DNS-01 challenge using the lego Tencent Cloud (tencentcloud) provider. Before touching the provider, it validates the incoming keyConfig map; if it is nil, or the SecretId/SecretKey entries are empty, it refuses to proceed with this localized message. Tencent Cloud's DNS API requires both an access key ID (SecretId) and its secret (SecretKey) to authenticate, so absent credentials make provider construction meaningless.","triggerScenarios":"Calling ApplySSLWithExistingServer with dnsProvider 'tencentcloud' whose keyConfig map is nil, or lacks non-empty 'SecretId' and 'SecretKey' entries (acme.go:130-132).","commonSituations":"User saved Tencent Cloud credentials in the UI but one field was left blank; config was loaded from an env/file where only SecretKey was set; a rename of the map key (e.g. 'SecretID' vs 'SecretId') silently yields an empty string; nil map passed when the DB row for DNS config is missing.","solutions":["Fill in both 'SecretId' and 'SecretKey' in the TencentCloud keyConfig map before calling ApplySSLWithExistingServer.","Verify exact key names: the lookup is keyConfig[\"SecretId\"] and keyConfig[\"SecretKey\"] (capital I in Id).","Check the persisted DNS provider config in the database/UI was actually saved and non-empty.","Create a Tencent Cloud API key pair in the console (CAM -> API Key) if none exists."],"exampleFix":"// before\nApplySSLWithExistingServer(..., \"tencentcloud\", map[string]string{\"SecretKey\": \"xxx\"})\n// after\nApplySSLWithExistingServer(..., \"tencentcloud\", map[string]string{\"SecretId\": \"AKID...\", \"SecretKey\": \"xxx\"})","handlingStrategy":"validation","validationCode":"if cfg, ok := keyConfig[\"tencentcloud\"]; !ok || cfg[\"SecretId\"] == \"\" || cfg[\"SecretKey\"] == \"\" {\n    return errors.New(\"tencentcloud DNS config requires non-empty SecretId and SecretKey\")\n}","typeGuard":"func hasTencentKeys(m map[string]string) bool {\n    return m != nil && m[\"SecretId\"] != \"\" && m[\"SecretKey\"] != \"\"\n}","tryCatchPattern":null,"preventionTips":["Validate credential maps at input boundaries before calling ApplySSLWithExistingServer.","Use exact map keys: SecretId, SecretKey.","Trim whitespace on credentials before storing them.","Fail the DNS-config save step in the UI when fields are blank."],"tags":["dns","acme","tencentcloud","missing-credentials","config"],"backgroundTag":"missing-api-credentials","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"}