{"record":{"id":"fd16ea13a8841d76","repo":"jeessy2/ddns-go","slug":"s-fd16ea","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dns/edgeone_origin.go","lineNumber":230,"sourceCode":"\t\tFilters []Filter `json:\"Filters\"`\n\t}{\n\t\tZoneId: zoneId,\n\t}\n\n\tif params.Has(\"GroupId\") {\n\t\trecord.Filters = []Filter{{Name: \"origin-group-id\", Values: []string{params.Get(\"GroupId\")}}}\n\t} else if params.Has(\"OriginGroupName\") {\n\t\trecord.Filters = []Filter{{Name: \"origin-group-name\", Values: []string{params.Get(\"OriginGroupName\")}}}\n\t} else {\n\t\treturn EdgeOneOriginGroup{}, fmt.Errorf(\"请在域名后追加 ?GroupId=xxx 或 ?OriginGroupName=xxx\")\n\t}\n\n\tvar result EdgeOneOriginGroupResponse\n\tif err := eo.request(\"DescribeOriginGroup\", record, &result); err != nil {\n\t\treturn EdgeOneOriginGroup{}, err\n\t}\n\tif result.Response.Error.Code != \"\" {\n\t\treturn EdgeOneOriginGroup{}, fmt.Errorf(\"%s\", result.Response.Error.Message)\n\t}\n\tif result.Response.TotalCount <= 0 || len(result.Response.OriginGroups) == 0 {\n\t\treturn EdgeOneOriginGroup{}, fmt.Errorf(\"在 EdgeOne 中未找到源站组: %s\", domain)\n\t}\n\n\tif params.Has(\"GroupId\") {\n\t\tgroupId := params.Get(\"GroupId\")\n\t\tfor _, group := range result.Response.OriginGroups {\n\t\t\tif group.GroupId == groupId {\n\t\t\t\treturn group, nil\n\t\t\t}\n\t\t}\n\t\treturn EdgeOneOriginGroup{}, fmt.Errorf(\"在 EdgeOne 中未找到源站组 GroupId=%s\", groupId)\n\t}\n\n\tgroupName := params.Get(\"OriginGroupName\")\n\tfor _, group := range result.Response.OriginGroups {\n\t\tif group.Name == groupName {","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/jeessy2/ddns-go/blob/5874c2e6667c69357ab95079421131104bd3fcae/dns/edgeone_origin.go#L212-L248","documentation":"getOriginGroup calls the EdgeOne DescribeOriginGroup API; even when the HTTP request succeeds, the response body can carry an API-level error inside Response.Error. When that Code field is non-empty, the library surfaces the API's own Message verbatim via fmt.Errorf(\"%s\", ...). This means Tencent Cloud rejected the DescribeOriginGroup call itself (auth, zone, or parameter problem), not that the origin group is missing.","triggerScenarios":"Calling addUpdateOriginGroups for a domain whose custom params contain GroupId/OriginGroupName, where DescribeOriginGroup returns Response.Error.Code != \"\" — e.g. invalid SecretId/SecretKey, a ZoneId the credential cannot access, unsupported filter name, or throttling (RequestLimitExceeded).","commonSituations":"Expired or rotated Tencent Cloud API keys; using a EdgeOne zone ID from a different account; the domain's zone not actually added to EdgeOne; API permission (cam policy) missing DescribeOriginGroup; rate limiting when many domains sync at once.","solutions":["Read the wrapped Message: it is EdgeOne's own error text and names the exact API failure (e.g. AuthFailure.SignatureFailure, ResourceNotFound, LimitExceeded).","Verify the EdgeOne SecretId/SecretKey in ddns-go config are valid and belong to the account owning the zone.","Confirm the site/zone exists in EdgeOne and getZoneId resolved correctly for this domain.","Check the domain's custom params (?GroupId= or ?OriginGroupName=) are well-formed for the API.","If the message is throttling, reduce sync frequency or the number of origin-group domains."],"exampleFix":"// before (hard to tell which API failed)\nreturn EdgeOneOriginGroup{}, fmt.Errorf(\"%s\", result.Response.Error.Message)\n// after (include code and action for diagnosis)\nreturn EdgeOneOriginGroup{}, fmt.Errorf(\"DescribeOriginGroup failed: code=%s msg=%s\", result.Response.Error.Code, result.Response.Error.Message)","handlingStrategy":"try-catch","validationCode":"// Go caller: check credentials/zone before relying on the sync\n// ensure domain config includes ?GroupId= or ?OriginGroupName=\nif !strings.Contains(domain, \"GroupId=\") && !strings.Contains(domain, \"OriginGroupName=\") {\n    return errors.New(\"edgeone origin-group domain must include ?GroupId= or ?OriginGroupName=\")\n}","typeGuard":null,"tryCatchPattern":"if err := eo.addUpdateOriginGroups(domains); err != nil {\n    // err may be an EdgeOne API Message (e.g. AuthFailure.*) — log and do NOT retry auth errors\n    if strings.Contains(err.Error(), \"AuthFailure\") {\n        log.Fatalf(\"fix EdgeOne credentials: %v\", err)\n    }\n    log.Printf(\"edgeone origin group sync failed: %v\", err)\n}","preventionTips":["Verify EdgeOne SecretId/SecretKey with a test DescribeOriginGroup call after rotating keys","Ensure the site/zone exists in EdgeOne before enabling origin-group mode in ddns-go","Grant the API key CAM permission for EdgeOne Describe/Modify APIs","Include both error Code and Message in logs to speed up diagnosis"],"tags":["edgeone","api-error","tencent-cloud","authentication"],"backgroundTag":"cloud-api-error-response","analyzedSha":"5874c2e6667c69357ab95079421131104bd3fcae","analyzedAt":"2026-09-03T15:41:16.799Z","contentChangedAt":"2026-09-03T15:41:16.799Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}