{"record":{"id":"b4d69b4f78ae7416","repo":"OpenNHP/opennhp","slug":"s-servers-d-and-servers-d-share-name","errorCode":null,"errorMessage":"%s: [[Servers]][%d] and [[Servers]][%d] share Name %q","messagePattern":"(.+?): \\[\\[Servers\\]\\]\\[(.+?)\\] and \\[\\[Servers\\]\\]\\[(.+?)\\] share Name %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nhp/common/clusterconfig/clusterconfig.go","lineNumber":231,"sourceCode":"\t// \"wrong instance answered\" at runtime.\n\tseenPK := make(map[string]int, len(clusters))\n\tfor i, c := range clusters {\n\t\tif prev, ok := seenPK[c.PubKeyBase64]; ok {\n\t\t\treturn fmt.Errorf(\"%s: [[Servers]][%d] and [[Servers]][%d] share PubKeyBase64 %s — \"+\n\t\t\t\t\"merge them into one cluster with multiple Instances\",\n\t\t\t\tlabel, prev, i, c.PubKeyBase64)\n\t\t}\n\t\tseenPK[c.PubKeyBase64] = i\n\t}\n\n\t// Duplicate Name detection — only meaningful when names are\n\t// required (and therefore non-empty). For consumers that leave Name\n\t// optional, blank names are allowed to repeat.\n\tif opts.RequireName {\n\t\tseenName := make(map[string]int, len(clusters))\n\t\tfor i, c := range clusters {\n\t\t\tif prev, ok := seenName[c.Name]; ok {\n\t\t\t\treturn fmt.Errorf(\"%s: [[Servers]][%d] and [[Servers]][%d] share Name %q\",\n\t\t\t\t\tlabel, prev, i, c.Name)\n\t\t\t}\n\t\t\tseenName[c.Name] = i\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":213,"sourceCodeEnd":239,"githubUrl":"https://github.com/OpenNHP/opennhp/blob/6e04ca5ff03222a699c24205cd4bf8fee9af7ffe/nhp/common/clusterconfig/clusterconfig.go#L213-L239","documentation":"Cluster-config validation error from Normalize's duplicate-name pass (only when opts.RequireName): two [[Servers]] entries use the same Name. Since resource.toml references clusters by Name, a duplicate would make the reference ambiguous, so the second occurrence is rejected with both indexes and the shared name.","triggerScenarios":"Thrown at nhp/common/clusterconfig/clusterconfig.go:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename one of the clusters to a unique Name","Update any resource.toml references that pointed at the renamed cluster"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6e04ca5ff03222a699c24205cd4bf8fee9af7ffe","analyzedAt":"2026-09-07T15:44:59.941Z","contentChangedAt":"2026-09-07T15:44:59.941Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}