jeessy2/ddns-go · error

在 EdgeOne 中未找到站点: %s

Error message

在 EdgeOne 中未找到站点: %s

What it means

This error is returned by getZoneId when the EdgeOne (Tencent Cloud) DescribeZones API returns TotalCount <= 0, meaning no zone matching the given domain exists in the EdgeOne account. The library requires the site to already exist in EdgeOne before it can resolve a ZoneId for origin group updates. Note the subsequent loop only matches zones whose ZoneName exactly equals domain.DomainName, so partial/parent-zone matches are not accepted.

Source

Thrown at dns/edgeone_origin.go:142

	if domain == nil {
		return false
	}
	params := domain.GetCustomParams()
	return params.Has("GroupId") || params.Has("OriginGroupName")
}

func (eo *EdgeOne) getZoneId(domain *config.Domain) (string, error) {
	params := domain.GetCustomParams()
	if params.Has("ZoneId") {
		return params.Get("ZoneId"), nil
	}

	zoneResult, err := eo.getZone(domain.DomainName)
	if err != nil {
		return "", err
	}
	if zoneResult.Response.TotalCount <= 0 {
		return "", fmt.Errorf("在 EdgeOne 中未找到站点: %s", domain.DomainName)
	}
	for _, zone := range zoneResult.Response.Zones {
		if zone.ZoneName == domain.DomainName {
			return zone.ZoneId, nil
		}
	}
	return "", fmt.Errorf("在 EdgeOne 中未找到站点: %s", domain.DomainName)
}

func (eo *EdgeOne) getDesiredOriginRecords(domainTuple *config.DomainTuple) ([]EdgeOneOriginRecord, error) {
	domain := domainTuple.Primary
	domainName := domain.String()
	weight := eo.getOriginWeight(domain)
	records := make([]EdgeOneOriginRecord, 0, 2)

	if eo.hasDomain(eo.Domains.Ipv4Domains, domainName) {
		if eo.Domains.Ipv4Addr == "" {
			return nil, fmt.Errorf("未能获取域名 %s 对应的 IPv4 地址", domain)

View on GitHub (pinned to 5874c2e666)

Solutions

  1. Add the domain as a site in the Tencent EdgeOne console (or via CreateZone API) before running the update
  2. Verify the domain.DomainName exactly matches the ZoneName shown in EdgeOne (case, no trailing dot, correct subdomain level)
  3. Confirm you are using credentials for the Tencent Cloud account that owns the EdgeOne site
  4. Check the site isn't stuck in pending/not-active state; complete domain ownership verification if needed

Example fix

// before
if zoneResult.Response.TotalCount <= 0 {
    return "", fmt.Errorf("在 EdgeOne 中未找到站点: %s", domain.DomainName)
}
// after
if zoneResult.Response.TotalCount <= 0 {
    return "", fmt.Errorf("在 EdgeOne 中未找到站点: %s,请先在 EdgeOne 控制台添加该站点并完成归属验证", domain.DomainName)
}
Defensive patterns

Strategy: validation

Validate before calling

// 调用前确认站点已在 EdgeOne 存在
zoneResult, err := eo.getZone(domain.DomainName)
if err != nil {
    return err
}
if zoneResult.Response.TotalCount <= 0 {
    return fmt.Errorf("站点 %s 不在 EdgeOne 中,请先在控制台添加", domain.DomainName)
}

Type guard

func zoneExists(zoneResult *ZoneListResult, domainName string) bool {
    for _, z := range zoneResult.Response.Zones {
        if z.ZoneName == domainName {
            return true
        }
    }
    return false
}

Try / catch

zoneId, err := eo.getZoneId(domain)
if err != nil {
    if strings.Contains(err.Error(), "未找到站点") {
        // 提示用户先去 EdgeOne 创建站点,或跳过该域名
        log.Warnf("跳过 %s: %v", domain.DomainName, err)
        return nil
    }
    return err
}

Prevention

When it happens

Trigger: Calling addUpdateDomainRecords/addUpdateOriginGroups for a domain that has no site added in the EdgeOne console; the domain is registered under a different Tencent Cloud account; the domain name passed differs in case or suffix (e.g. subdomain vs apex) from the zone name in EdgeOne.

Common situations: User set up DNS records in dnsla/alidns but never added the site to EdgeOne; domain added to EdgeOne in another account or region; typo in the configured domain name (e.g. 'example.com.' with trailing dot); EdgeOne site still pending ownership verification and thus not listed.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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