{"record":{"id":"0009b1ce36d23393","repo":"apache/beam","slug":"resource-parsemaxactivebundlesperworker-unable-to-parse-q-v","errorCode":null,"errorMessage":"resource.ParseMaxActiveBundlesPerWorker: unable to parse %q: %v","messagePattern":"resource\\.ParseMaxActiveBundlesPerWorker: unable to parse %q: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/options/resource/hint.go","lineNumber":206,"sourceCode":"\t// Max active bundles merge should be summed instead of taking the max.\n\treturn MaxActiveBundlesPerWorker(outer.(maxActiveBundlesPerWorkerHint).value + h.value)\n}\n\nfunc (h maxActiveBundlesPerWorkerHint) String() string {\n\treturn fmt.Sprintf(\"max_active_bundles_per_worker=%v\", uint64(h.value))\n}\n\n// ParseMaxActiveBundlesPerWorker converts an int in string form into a hint.\n// An invalid size format will cause ParseMaxActiveBundlesPerWorker to panic.\n//\n// Hints are advisory only and runners may not respect them.\n//\n// See https://beam.apache.org/documentation/runtime/resource-hints/ for more information about\n// resource hints.\nfunc ParseMaxActiveBundlesPerWorker(v string) Hint {\n\tb, err := strconv.Atoi(v)\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"resource.ParseMaxActiveBundlesPerWorker: unable to parse %q: %v\", v, err))\n\t}\n\treturn MaxActiveBundlesPerWorker(int64(b))\n}\n\n// Accelerator hints that this scope should be put in a machine with a given accelerator.\n//\n// Hints for accelerators will have formats that are runner specific.\n// For example, the following is valid accelerator syntax for the Dataflow runner:\n//\n//\taccelerator=\"type:<type>;count:<n>;<options>\"\n//\n// Hints are advisory only and runners may not respect them.\n//\n// See https://beam.apache.org/documentation/runtime/resource-hints/ for more information about\n// resource hints.\nfunc Accelerator(v string) Hint {\n\treturn acceleratorHint{value: v}\n}","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/options/resource/hint.go#L188-L224","documentation":"ParseMaxActiveBundlesPerWorker converts a string to an integer bundle count hint using strconv.Atoi. On parse failure it panics with 'resource.ParseMaxActiveBundlesPerWorker: unable to parse %q: %v', since the hint value must be a plain integer.","triggerScenarios":"Calling resource.ParseMaxActiveBundlesPerWorker with a non-integer string like 'ten' or '3.5', or via --resource_hints with such a value for this hint.","commonSituations":"Passing a suffixed number ('10x'), a float, or an empty string from an unset/unquoted environment variable or flag.","solutions":["Supply a plain base-10 integer string, e.g. '10'","Trim whitespace and strip any suffix/units from the value","Validate with strconv.Atoi in the caller before constructing the hint"],"exampleFix":"// before\nresource.ParseMaxActiveBundlesPerWorker(\"3.5\")\n// after\nresource.ParseMaxActiveBundlesPerWorker(\"3\")","handlingStrategy":"validation","validationCode":"if n, err := strconv.Atoi(v); err != nil || n <= 0 {\n    return fmt.Errorf(\"invalid bundle count %q\", v)\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"ParseMaxActiveBundlesPerWorker rejected value: %v\", r)\n    }\n}()","preventionTips":["Pass plain base-10 integer strings without units or decimals","Strip whitespace/suffixes from flag or env-derived values","Default the value explicitly when the config source may be empty"],"tags":["go","beam","resource-hints","parsing"],"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"}