{"id":"6cad8d9d68637171","repo":"docker/cli","slug":"duplicate-secret-target-for-s-not-allowed","errorCode":null,"errorMessage":"duplicate secret target for %s not allowed","messagePattern":"duplicate secret target for (.+?) not allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/parse.go","lineNumber":22,"sourceCode":"\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/moby/moby/api/types/swarm\"\n\t\"github.com/moby/moby/client\"\n)\n\n// ParseSecrets retrieves the secrets with the requested names and fills\n// secret IDs into the secret references.\nfunc ParseSecrets(ctx context.Context, apiClient client.SecretAPIClient, requestedSecrets []*swarm.SecretReference) ([]*swarm.SecretReference, error) {\n\tif len(requestedSecrets) == 0 {\n\t\treturn []*swarm.SecretReference{}, nil\n\t}\n\n\tsecretRefs := make(map[string]*swarm.SecretReference)\n\n\tfor _, secret := range requestedSecrets {\n\t\tif _, exists := secretRefs[secret.File.Name]; exists {\n\t\t\treturn nil, fmt.Errorf(\"duplicate secret target for %s not allowed\", secret.SecretName)\n\t\t}\n\t\tsecretRef := new(swarm.SecretReference)\n\t\t*secretRef = *secret\n\t\tsecretRefs[secret.File.Name] = secretRef\n\t}\n\n\targs := make(client.Filters)\n\tfor _, s := range secretRefs {\n\t\targs.Add(\"name\", s.SecretName)\n\t}\n\n\tres, err := apiClient.SecretList(ctx, client.SecretListOptions{\n\t\tFilters: args,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/parse.go#L4-L40","documentation":"Error \"duplicate secret target for %s not allowed\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/parse.go:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}