jeessy2/ddns-go · error

%s

Error message

%s

What it means

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.

Source

Thrown at dns/edgeone_origin.go:230

		Filters []Filter `json:"Filters"`
	}{
		ZoneId: zoneId,
	}

	if params.Has("GroupId") {
		record.Filters = []Filter{{Name: "origin-group-id", Values: []string{params.Get("GroupId")}}}
	} else if params.Has("OriginGroupName") {
		record.Filters = []Filter{{Name: "origin-group-name", Values: []string{params.Get("OriginGroupName")}}}
	} else {
		return EdgeOneOriginGroup{}, fmt.Errorf("请在域名后追加 ?GroupId=xxx 或 ?OriginGroupName=xxx")
	}

	var result EdgeOneOriginGroupResponse
	if err := eo.request("DescribeOriginGroup", record, &result); err != nil {
		return EdgeOneOriginGroup{}, err
	}
	if result.Response.Error.Code != "" {
		return EdgeOneOriginGroup{}, fmt.Errorf("%s", result.Response.Error.Message)
	}
	if result.Response.TotalCount <= 0 || len(result.Response.OriginGroups) == 0 {
		return EdgeOneOriginGroup{}, fmt.Errorf("在 EdgeOne 中未找到源站组: %s", domain)
	}

	if params.Has("GroupId") {
		groupId := params.Get("GroupId")
		for _, group := range result.Response.OriginGroups {
			if group.GroupId == groupId {
				return group, nil
			}
		}
		return EdgeOneOriginGroup{}, fmt.Errorf("在 EdgeOne 中未找到源站组 GroupId=%s", groupId)
	}

	groupName := params.Get("OriginGroupName")
	for _, group := range result.Response.OriginGroups {
		if group.Name == groupName {

View on GitHub (pinned to 5874c2e666)

Solutions

  1. Read the wrapped Message: it is EdgeOne's own error text and names the exact API failure (e.g. AuthFailure.SignatureFailure, ResourceNotFound, LimitExceeded).
  2. Verify the EdgeOne SecretId/SecretKey in ddns-go config are valid and belong to the account owning the zone.
  3. Confirm the site/zone exists in EdgeOne and getZoneId resolved correctly for this domain.
  4. Check the domain's custom params (?GroupId= or ?OriginGroupName=) are well-formed for the API.
  5. If the message is throttling, reduce sync frequency or the number of origin-group domains.

Example fix

// before (hard to tell which API failed)
return EdgeOneOriginGroup{}, fmt.Errorf("%s", result.Response.Error.Message)
// after (include code and action for diagnosis)
return EdgeOneOriginGroup{}, fmt.Errorf("DescribeOriginGroup failed: code=%s msg=%s", result.Response.Error.Code, result.Response.Error.Message)
Defensive patterns

Strategy: try-catch

Validate before calling

// Go caller: check credentials/zone before relying on the sync
// ensure domain config includes ?GroupId= or ?OriginGroupName=
if !strings.Contains(domain, "GroupId=") && !strings.Contains(domain, "OriginGroupName=") {
    return errors.New("edgeone origin-group domain must include ?GroupId= or ?OriginGroupName=")
}

Try / catch

if err := eo.addUpdateOriginGroups(domains); err != nil {
    // err may be an EdgeOne API Message (e.g. AuthFailure.*) — log and do NOT retry auth errors
    if strings.Contains(err.Error(), "AuthFailure") {
        log.Fatalf("fix EdgeOne credentials: %v", err)
    }
    log.Printf("edgeone origin group sync failed: %v", err)
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of jeessy2/ddns-go@5874c2e666 (2026-09-03). Data as JSON: /api/errors/fd16ea13a8841d76. Report an issue: GitHub.