{"record":{"id":"c1d9f6dbd076c693","repo":"apache/beam","slug":"unknown-resource-hint-v","errorCode":null,"errorMessage":"unknown resource hint: %v","messagePattern":"unknown resource hint: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/options/jobopts/options.go","lineNumber":216,"sourceCode":"\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}\n\treturn resource.NewHints(hints...)\n}\n\n// stringHint is a backup implementation of hint for new standard hints.\ntype stringHint struct {\n\turn, value string\n}\n\nfunc (h stringHint) URN() string {\n\treturn h.urn\n}\n\nfunc (h stringHint) Payload() []byte {\n\t// Go strings are utf8, and if the string is ascii,","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/options/jobopts/options.go#L198-L234","documentation":"GetPipelineResourceHints recognizes only min_ram, accelerator, and cpu_count hints (by short name or full URN); URN-shaped names starting with 'beam:resources:' are accepted as opaque string hints. Any other hint name falls through to a panic with 'unknown resource hint: %v'.","triggerScenarios":"Passing a hint like --resource_hints=bogus_hint=5 or 'ram=8GiB' whose name is not a known hint and does not start with 'beam:resources:'.","commonSituations":"Misspelling a hint name (e.g. 'minram' or 'min-ram'), using a hint from a different runner, or inventing a custom hint without the required 'beam:resources:' URN prefix.","solutions":["Use a supported hint name: min_ram, accelerator, or cpu_count","For custom hints, use the full URN form starting with 'beam:resources:', e.g. beam:resources:my_hint:v1=value","Fix the typo by consulting the Beam resource hints documentation"],"exampleFix":"// before\n--resource_hints=minram=8GiB\n// after\n--resource_hints=min_ram=8GiB","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"min_ram\": true, \"accelerator\": true, \"cpu_count\": true}\nfor _, h := range hints {\n    name, _, ok := strings.Cut(h, \"=\")\n    if !ok || (!valid[name] && !strings.HasPrefix(name, \"beam:resources:\")) {\n        return fmt.Errorf(\"unknown resource hint %q\", name)\n    }\n}","typeGuard":"func isKnownHint(name string) bool {\n    switch name {\n    case \"min_ram\", \"accelerator\", \"cpu_count\":\n        return true\n    }\n    return strings.HasPrefix(name, \"beam:resources:\")\n}","tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"resource hints invalid: %v\", r)\n    }\n}()","preventionTips":["Spell hint names exactly as documented (min_ram, accelerator, cpu_count)","Prefix custom hints with beam:resources: so they parse as opaque string hints","Check the Beam resource hints docs page before adding new hint names"],"tags":["go","beam","cli","resource-hints","config"],"backgroundTag":"invalid-enum-value","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"}