{"record":{"id":"3be8682d35183037","repo":"jeessy2/ddns-go","slug":"s-ipv4","errorCode":null,"errorMessage":"未能获取域名 %s 对应的 IPv4 地址","messagePattern":"未能获取域名 (.+?) 对应的 IPv4 地址","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dns/edgeone_origin.go","lineNumber":160,"sourceCode":"\t\treturn \"\", fmt.Errorf(\"在 EdgeOne 中未找到站点: %s\", domain.DomainName)\n\t}\n\tfor _, zone := range zoneResult.Response.Zones {\n\t\tif zone.ZoneName == domain.DomainName {\n\t\t\treturn zone.ZoneId, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"在 EdgeOne 中未找到站点: %s\", domain.DomainName)\n}\n\nfunc (eo *EdgeOne) getDesiredOriginRecords(domainTuple *config.DomainTuple) ([]EdgeOneOriginRecord, error) {\n\tdomain := domainTuple.Primary\n\tdomainName := domain.String()\n\tweight := eo.getOriginWeight(domain)\n\trecords := make([]EdgeOneOriginRecord, 0, 2)\n\n\tif eo.hasDomain(eo.Domains.Ipv4Domains, domainName) {\n\t\tif eo.Domains.Ipv4Addr == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"未能获取域名 %s 对应的 IPv4 地址\", domain)\n\t\t}\n\t\trecords = append(records, EdgeOneOriginRecord{\n\t\t\tRecord: eo.Domains.Ipv4Addr,\n\t\t\tType:   edgeoneOriginRecordType,\n\t\t\tWeight: weight,\n\t\t})\n\t}\n\tif eo.hasDomain(eo.Domains.Ipv6Domains, domainName) {\n\t\tif eo.Domains.Ipv6Addr == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"未能获取域名 %s 对应的 IPv6 地址\", domain)\n\t\t}\n\t\trecords = append(records, EdgeOneOriginRecord{\n\t\t\tRecord: eo.Domains.Ipv6Addr,\n\t\t\tType:   edgeoneOriginRecordType,\n\t\t\tWeight: weight,\n\t\t})\n\t}\n\tif len(records) == 0 {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/jeessy2/ddns-go/blob/5874c2e6667c69357ab95079421131104bd3fcae/dns/edgeone_origin.go#L142-L178","documentation":"A validation guard inside getDesiredOriginRecords: the domain was matched against eo.Domains.Ipv4Domains, so an IPv4 origin record is expected, but eo.Domains.Ipv4Addr is empty — the resolver/config layer never populated the IPv4 address for this domain. The error fires before any EdgeOne API call, failing the origin-record build for addUpdateOriginGroups.","triggerScenarios":"Thrown at dns/edgeone_origin.go:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check why the IPv4 address resolution step left eo.Domains.Ipv4Addr empty for this domain (DNS A-record lookup failure or skipped resolution)","Verify the domain actually has an A record / IPv4 origin configured upstream","If the domain is IPv6-only, remove it from Ipv4Domains so the guard is not triggered","Re-run after ensuring the address-population step executes before addUpdateOriginGroups"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}