{"record":{"id":"020ecce9944f5e5f","repo":"Billionmail/BillionMail","slug":"dns-automated-resolution-failed-apikey-or-apisecr","errorCode":null,"errorMessage":"DNS automated resolution failed: APIKey or APISecret is empty in Godaddy configuration file","messagePattern":"DNS automated resolution failed: APIKey or APISecret is empty in Godaddy configuration file","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/acme/acme.go","lineNumber":271,"sourceCode":"\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\n\treturn nil\n}\n\n/**\n * @description: Configure DNS verification via GoDaddy\n * @param {*lego.Client} client Client\n * @param {map[string]string} keyConfig Configuration information\n * @return error Error information\n */\nfunc SetDnsGodaddy(ctx context.Context, client *lego.Client, keyConfig map[string]string) error {\n\tif keyConfig == nil || keyConfig[\"APIKey\"] == \"\" || keyConfig[\"APISecret\"] == \"\" {\n\t\treturn errors.New(public.LangCtx(ctx, \"DNS automated resolution failed: APIKey or APISecret is empty in Godaddy configuration file\"))\n\t}\n\n\tcfg := godaddy.NewDefaultConfig()\n\tcfg.APIKey = keyConfig[\"APIKey\"]\n\tcfg.APISecret = keyConfig[\"APISecret\"]\n\n\tp, err := godaddy.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\n\treturn nil\n}","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/acme/acme.go#L253-L289","documentation":"SetDnsGodaddy pre-validates its keyConfig map before constructing the lego GoDaddy DNS provider. GoDaddy's API authenticates with an API key/secret pair (HTTP signature), so if keyConfig is nil or APIKey or APISecret is empty, the function fails fast with this fixed message.","triggerScenarios":"ApplySSLWithExistingServer with vtype=\"dns\" and dnsProvider=\"godaddy\" where the token map lacks APIKey or APISecret, or is entirely nil.","commonSituations":"Users enter only the key and forget the secret (GoDaddy's UI produces both); the JSON config keys are misspelled (e.g. \"api_key\") so map lookups return empty strings; a GoDaddy API key was revoked and the reissued one was stored under the wrong field.","solutions":["Provide both APIKey and APISecret from the GoDaddy Developer Portal (API Keys section).","Check the config keys are named exactly APIKey and APISecret (case-sensitive).","Trim quotes, spaces, and newlines from pasted values.","Regenerate the key pair if the old one was revoked or expired."],"exampleFix":"// before\nkeyConfig := map[string]string{\"APIKey\": apiKey} // APISecret missing\nerr := SetDnsGodaddy(ctx, client, keyConfig)\n// after\nkeyConfig := map[string]string{\"APIKey\": apiKey, \"APISecret\": apiSecret}\nerr := SetDnsGodaddy(ctx, client, keyConfig)","handlingStrategy":"validation","validationCode":"func goDaddyConfigReady(kc map[string]string) bool {\n    return kc != nil && strings.TrimSpace(kc[\"APIKey\"]) != \"\" && strings.TrimSpace(kc[\"APISecret\"]) != \"\"\n}","typeGuard":"func hasGoDaddyKeys(kc map[string]string) bool {\n    return kc != nil && kc[\"APIKey\"] != \"\" && kc[\"APISecret\"] != \"\"\n}","tryCatchPattern":"if err := SetDnsGodaddy(ctx, client, tokens); err != nil {\n    if strings.Contains(err.Error(), \"APISecret\") {\n        return errors.New(\"GoDaddy API key pair incomplete — supply both APIKey and APISecret\")\n    }\n    return err\n}","preventionTips":["Treat APIKey and APISecret as a mandatory pair in the provider config form.","Reject misspelled keys (api_key, secret) with a schema validation on config load.","Trim whitespace and strip surrounding quotes from pasted credentials.","Use production keys, not OTE test keys."],"tags":["go","acme","dns","godaddy","missing-credentials"],"backgroundTag":"missing-env-var","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"}