jeessy2/ddns-go · error

在 EdgeOne 中未找到源站组 GroupId=%s

Error message

在 EdgeOne 中未找到源站组 GroupId=%s

What it means

When the domain's custom params specify GroupId, getOriginGroup filters DescribeOriginGroup by origin-group-id and then re-checks each returned group for an exact GroupId match. If the API returns rows but none has that GroupId, it fails with 'origin group not found GroupId=<id>'. This guards against the API returning stale or differently-scoped results.

Source

Thrown at dns/edgeone_origin.go:243

	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 {
			return group, nil
		}
	}
	if len(result.Response.OriginGroups) == 1 {
		return result.Response.OriginGroups[0], nil
	}
	return EdgeOneOriginGroup{}, fmt.Errorf("找到多个名称匹配的源站组,请改用 GroupId 指定唯一源站组")
}

func (eo *EdgeOne) modifyOriginGroup(originGroup EdgeOneOriginGroup, domainTuple *config.DomainTuple, zoneId string, records []EdgeOneOriginRecord) {
	if sameEdgeOneOriginRecords(originGroup.Records, records) {
		util.Log("你的IP %s 没有变化, EdgeOne 源站组 %s", strings.Join(edgeOneOriginRecordValues(records), ","), originGroup.Name)
		return

View on GitHub (pinned to 5874c2e666)

Solutions

  1. Open the EdgeOne console, copy the current GroupId of the target origin group, and update the domain's ?GroupId= param.
  2. If unsure of the ID, switch to ?OriginGroupName=<name> instead.
  3. Confirm the group belongs to the same site/zone that getZoneId resolved for this domain.
  4. Trim whitespace and ensure the full ID was pasted.

Example fix

// before
domain.example.com?GroupId=og-9x8y7z
// after (correct current group id from EdgeOne console)
domain.example.com?GroupId=og-1a2b3c4d
Defensive patterns

Strategy: validation

Validate before calling

// Validate the GroupId param format and presence before running ddns-go
id := customParams.Get("GroupId")
if id == "" || strings.TrimSpace(id) != id {
    return errors.New("GroupId must be a non-empty, trimmed id from the EdgeOne console")
}

Prevention

When it happens

Trigger: addUpdateOriginGroups -> getOriginGroup with ?GroupId=<id> in the domain, where the filtered OriginGroups list contains no group whose GroupId equals the requested id.

Common situations: GroupId copied from the wrong zone or account; the group was deleted and recreated (new auto-generated ID); ID pasted with whitespace or truncated; the zone's ID in the request doesn't match the group's actual zone.

Related errors


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