{"id":"49d6731dba222a86","repo":"docker/cli","slug":"invalid-generic-resource-format-s-expected-nam","errorCode":null,"errorMessage":"invalid generic-resource format `%s` expected `name=value`","messagePattern":"invalid generic-resource format `(.+?)` expected `name=value`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/service/generic_resource_opts.go","lineNumber":21,"sourceCode":"import (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/cli/cli/command/service/internal/genericresource\"\n\t\"github.com/moby/moby/api/types/swarm\"\n)\n\n// GenericResource is a concept that a user can use to advertise user-defined\n// resources on a node and thus better place services based on these resources.\n// E.g: NVIDIA GPUs, Intel FPGAs, ...\n// See https://github.com/moby/swarmkit/blob/de950a7ed842c7b7e47e9451cde9bf8f96031894/design/generic_resources.md\n\n// ValidateSingleGenericResource validates that a single entry in the\n// generic resource list is valid.\n// i.e 'GPU=UID1' is valid however 'GPU:UID1' or 'UID1' isn't\nfunc ValidateSingleGenericResource(val string) (string, error) {\n\tif strings.Count(val, \"=\") < 1 {\n\t\treturn \"\", fmt.Errorf(\"invalid generic-resource format `%s` expected `name=value`\", val)\n\t}\n\n\treturn val, nil\n}\n\n// ParseGenericResources parses an array of Generic resourceResources\n// Requesting Named Generic Resources for a service is not supported this\n// is filtered here.\nfunc ParseGenericResources(value []string) ([]swarm.GenericResource, error) {\n\tif len(value) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tswarmResources, err := genericresource.Parse(value)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid generic resource specification: %w\", err)\n\t}\n","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/service/generic_resource_opts.go#L3-L39","documentation":"Error \"invalid generic-resource format `%s` expected `name=value`\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/service/generic_resource_opts.go:21 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}