{"id":"ae70e12274ce00bd","repo":"docker/cli","slug":"could-not-find-generic-resource-s-to-remove-it","errorCode":null,"errorMessage":"could not find generic-resource `%s` to remove it","messagePattern":"could not find generic-resource `(.+?)` to remove it","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/update.go","lineNumber":614,"sourceCode":"\n\tif spec.Resources == nil {\n\t\tspec.Resources = &swarm.ResourceRequirements{}\n\t}\n\n\tif spec.Resources.Reservations == nil {\n\t\tspec.Resources.Reservations = &swarm.Resources{}\n\t}\n\n\tvalues := flags.Lookup(flagGenericResourcesRemove).Value.(*opts.ListOpts).GetSlice()\n\n\tm, err := buildGenericResourceMap(spec.Resources.Reservations.GenericResources)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor _, toRemoveRes := range values {\n\t\tif _, ok := m[toRemoveRes]; !ok {\n\t\t\treturn fmt.Errorf(\"could not find generic-resource `%s` to remove it\", toRemoveRes)\n\t\t}\n\n\t\tdelete(m, toRemoveRes)\n\t}\n\n\tspec.Resources.Reservations.GenericResources = buildGenericResourceList(m)\n\treturn nil\n}\n\nfunc updatePlacementConstraints(flags *pflag.FlagSet, placement *swarm.Placement) {\n\tif flags.Changed(flagConstraintAdd) {\n\t\tvalues := flags.Lookup(flagConstraintAdd).Value.(*opts.ListOpts).GetSlice()\n\t\tplacement.Constraints = append(placement.Constraints, values...)\n\t}\n\ttoRemove := buildToRemoveSet(flags, flagConstraintRemove)\n\n\tnewConstraints := []string{}\n\tfor _, constraint := range placement.Constraints {","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/update.go#L596-L632","documentation":"Error \"could not find generic-resource `%s` to remove it\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/update.go:614 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}