{"record":{"id":"f5bd64ed70254ab6","repo":"jeessy2/ddns-go","slug":"groupid","errorCode":null,"errorMessage":"找到多个名称匹配的源站组，请改用 GroupId 指定唯一源站组","messagePattern":"找到多个名称匹配的源站组，请改用 GroupId 指定唯一源站组","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dns/edgeone_origin.go","lineNumber":255,"sourceCode":"\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 {\n\t\t\treturn group, nil\n\t\t}\n\t}\n\tif len(result.Response.OriginGroups) == 1 {\n\t\treturn result.Response.OriginGroups[0], nil\n\t}\n\treturn EdgeOneOriginGroup{}, fmt.Errorf(\"找到多个名称匹配的源站组，请改用 GroupId 指定唯一源站组\")\n}\n\nfunc (eo *EdgeOne) modifyOriginGroup(originGroup EdgeOneOriginGroup, domainTuple *config.DomainTuple, zoneId string, records []EdgeOneOriginRecord) {\n\tif sameEdgeOneOriginRecords(originGroup.Records, records) {\n\t\tutil.Log(\"你的IP %s 没有变化, EdgeOne 源站组 %s\", strings.Join(edgeOneOriginRecordValues(records), \",\"), originGroup.Name)\n\t\treturn\n\t}\n\n\tvar status EdgeOneStatus\n\terr := eo.request(\n\t\t\"ModifyOriginGroup\",\n\t\tstruct {\n\t\t\tZoneId  string                `json:\"ZoneId\"`\n\t\t\tGroupId string                `json:\"GroupId\"`\n\t\t\tRecords []EdgeOneOriginRecord `json:\"Records\"`\n\t\t}{\n\t\t\tZoneId:  zoneId,\n\t\t\tGroupId: originGroup.GroupId,","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/jeessy2/ddns-go/blob/5874c2e6667c69357ab95079421131104bd3fcae/dns/edgeone_origin.go#L237-L273","documentation":"When identifying the origin group by OriginGroupName (no GroupId given), multiple groups in the zone can match the name filter. The library refuses to guess: if the name doesn't exactly match exactly one group and more than one group was returned, it errors asking the user to specify GroupId. Ambiguity here would cause ddns-go to update the wrong group's origin records.","triggerScenarios":"addUpdateOriginGroups -> getOriginGroup with ?OriginGroupName=<name>; no returned group's Name exactly equals the param, OriginGroups has more than one entry (the len==1 fallback doesn't apply), so the ambiguous-name branch triggers.","commonSituations":"Two origin groups share similar names and the param is a partial/substring name; groups renamed over time leaving duplicates; user expected fuzzy matching but the code only accepts an exact Name match before falling back to the single-result case.","solutions":["Use ?GroupId=<id> in the domain config to unambiguously select the origin group.","Rename origin groups in the EdgeOne console so names are unique, then match the param exactly to one group's Name.","Set OriginGroupName to the exact full Name as shown in EdgeOne, not a substring.","Delete duplicate origin groups that are no longer used."],"exampleFix":"// before (ambiguous name)\ndomain.example.com?OriginGroupName=my-origin\n// after (unique id)\ndomain.example.com?GroupId=og-1a2b3c4d","handlingStrategy":"validation","validationCode":"// Ensure the configured name uniquely matches exactly one group before syncing:\n// DescribeOriginGroup with Filters=[{Name:\"origin-group-name\",Values:[\"<name>\"]}] must return TotalCount == 1\n// otherwise switch config to ?GroupId=<id>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep origin group names unique within the EdgeOne site","Always specify ?GroupId= when more than one group could match","Avoid partial names; use the exact full group Name","Periodically audit for leftover duplicate groups"],"tags":["edgeone","origin-group","ambiguity","configuration"],"backgroundTag":"ambiguous-resource-name","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"}