{"record":{"id":"d9aa72dc21d00936","repo":"getsops/sops","slug":"duplicate-part-detected","errorCode":null,"errorMessage":"duplicate part detected","messagePattern":"duplicate part detected","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shamir/shamir.go","lineNumber":288,"sourceCode":"\t\t}\n\t}\n\n\t// Create a buffer to store the reconstructed secret\n\tsecret := make([]byte, firstPartLen-1)\n\n\t// Buffer to store the samples\n\txSamples := make([]uint8, len(parts))\n\tySamples := make([]uint8, len(parts))\n\n\t// Set the x value for each sample and ensure no x_sample values are the same,\n\t// otherwise div() can be unhappy\n\t// Check that we don't have any duplicate parts, that is, two or\n\t// more parts with the same x coordinate.\n\tcheckMap := map[byte]bool{}\n\tfor i, part := range parts {\n\t\tsamp := part[firstPartLen-1]\n\t\tif exists := checkMap[samp]; exists {\n\t\t\treturn nil, fmt.Errorf(\"duplicate part detected\")\n\t\t}\n\t\tcheckMap[samp] = true\n\t\txSamples[i] = samp\n\t}\n\n\t// Reconstruct each byte\n\tfor idx := range secret {\n\t\t// Set the y value for each sample\n\t\tfor i, part := range parts {\n\t\t\tySamples[i] = part[idx]\n\t\t}\n\n\t\t// Use Lagrange interpolation to retrieve the free term\n\t\t// of the original polynomial\n\t\tval := interpolatePolynomial(xSamples, ySamples, 0)\n\n\t\t// Evaluate the 0th value to get the intercept\n\t\tsecret[idx] = val","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/shamir/shamir.go#L270-L306","documentation":"Error \"duplicate part detected\" thrown in getsops/sops.","triggerScenarios":"Thrown at shamir/shamir.go:288 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}