{"record":{"id":"a1aab223314e7fb9","repo":"apache/beam","slug":"unparsable-resource-hint-q","errorCode":null,"errorMessage":"unparsable resource hint: %q","messagePattern":"unparsable resource hint: %q","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/options/jobopts/options.go","lineNumber":202,"sourceCode":"}\n\n// GetElementProcessingTimeout returns the element processing timeout. If the flag is set to -1,\n// there is no timeout.\nfunc GetElementProcessingTimeout() time.Duration {\n\tif *ElementProcessingTimeout == -1 {\n\t\treturn 0 * time.Minute\n\t}\n\treturn *ElementProcessingTimeout\n}\n\n// GetPipelineResourceHints parses known standard hints and returns the flag set hints for the pipeline.\n// In case of duplicate hint URNs, the last value specified will be used.\nfunc GetPipelineResourceHints() resource.Hints {\n\thints := make([]resource.Hint, 0, len(ResourceHints))\n\tfor _, hint := range ResourceHints {\n\t\tname, val, ok := strings.Cut(hint, \"=\")\n\t\tif !ok {\n\t\t\tpanic(fmt.Sprintf(\"unparsable resource hint: %q\", hint))\n\t\t}\n\t\tvar h resource.Hint\n\t\tswitch name {\n\t\tcase \"min_ram\", \"beam:resources:min_ram_bytes:v1\":\n\t\t\th = resource.ParseMinRAM(val)\n\t\tcase \"accelerator\", \"beam:resources:accelerator:v1\":\n\t\t\th = resource.Accelerator(val)\n\t\tcase \"cpu_count\", \"beam:resources:cpu_count:v1\":\n\t\t\th = resource.ParseCPUCount(val)\n\t\tdefault:\n\t\t\tif strings.HasPrefix(name, \"beam:resources:\") {\n\t\t\t\th = stringHint{urn: name, value: val}\n\t\t\t} else {\n\t\t\t\tpanic(fmt.Sprintf(\"unknown resource hint: %v\", hint))\n\t\t\t}\n\t\t}\n\t\thints = append(hints, h)\n\t}","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/options/jobopts/options.go#L184-L220","documentation":"GetPipelineResourceHints parses each entry of the ResourceHints job-option slice, which must be in NAME=VALUE form. If a hint string contains no '=' sign, strings.Cut fails and the function panics with 'unparsable resource hint: %q'. This happens at pipeline submission time when the --resource_hints flag value is malformed.","triggerScenarios":"Setting jobopts.ResourceHints (e.g. via the --resource_hints flag or programmatically) to a string without '=', such as 'min_ram' or 'accelerator:gpu' instead of 'min_ram=8GiB'.","commonSituations":"Typos in the --resource_hints CLI flag, shell quoting issues dropping the '=value' part, or building the hints slice programmatically without validating the key=value format.","solutions":["Correct the hint string to 'name=value' form, e.g. --resource_hints=min_ram=8GiB","Check shell quoting/escaping so the '=' and value are not stripped","Validate each entry with strings.Contains(hint, \"=\") before populating jobopts.ResourceHints"],"exampleFix":"// before\nResourceHints: []string{\"min_ram\"}\n// after\nResourceHints: []string{\"min_ram=8GiB\"}","handlingStrategy":"validation","validationCode":"for _, h := range hints {\n    if !strings.Contains(h, \"=\") {\n        return fmt.Errorf(\"resource hint %q must be name=value\", h)\n    }\n}","typeGuard":"func isParsableHint(h string) bool { return strings.Contains(h, \"=\") }","tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"resource hints invalid: %v\", r)\n    }\n}()","preventionTips":["Always write resource hints as name=value pairs","Quote flags in shell to avoid the =value part being mangled","Sanity-check jobopts.ResourceHints contents before pipeline submission"],"tags":["go","beam","cli","resource-hints","config"],"backgroundTag":"invalid-argument-format","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}