{"record":{"id":"8a839afdd42d91a0","repo":"grafana/k6","slug":"invalid-maxsendsize-value-v-it-needs-to-be-a","errorCode":null,"errorMessage":"invalid maxSendSize value: '%#v', it needs to be an integer","messagePattern":"invalid maxSendSize value: '%#v', it needs to be an integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/grpc/params.go","lineNumber":197,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn result, fmt.Errorf(\"invalid reflectMetadata param: %w\", err)\n\t\t\t}\n\n\t\t\tresult.ReflectionMetadata = md\n\t\tcase \"maxReceiveSize\":\n\t\t\tvar ok bool\n\t\t\tresult.MaxReceiveSize, ok = v.(int64)\n\t\t\tif !ok {\n\t\t\t\treturn result, fmt.Errorf(\"invalid maxReceiveSize value: '%#v', it needs to be an integer\", v)\n\t\t\t}\n\t\t\tif result.MaxReceiveSize < 0 {\n\t\t\t\treturn result, fmt.Errorf(\"invalid maxReceiveSize value: '%#v, it needs to be a positive integer\", v)\n\t\t\t}\n\t\tcase \"maxSendSize\":\n\t\t\tvar ok bool\n\t\t\tresult.MaxSendSize, ok = v.(int64)\n\t\t\tif !ok {\n\t\t\t\treturn result, fmt.Errorf(\"invalid maxSendSize value: '%#v', it needs to be an integer\", v)\n\t\t\t}\n\t\t\tif result.MaxSendSize < 0 {\n\t\t\t\treturn result, fmt.Errorf(\"invalid maxSendSize value: '%#v, it needs to be a positive integer\", v)\n\t\t\t}\n\t\tcase \"tls\":\n\t\t\tif err := parseConnectTLSParam(result, v); err != nil {\n\t\t\t\treturn result, err\n\t\t\t}\n\t\tcase \"authority\":\n\t\t\tvar ok bool\n\t\t\tresult.Authority, ok = v.(string)\n\t\t\tif !ok {\n\t\t\t\treturn result, fmt.Errorf(\"invalid authority value: '%#v', it needs to be a string\", v)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn result, fmt.Errorf(\"unknown connect param: %q\", k)\n\t\t}\n\t}","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/grpc/params.go#L179-L215","documentation":"maxSendSize in client.connect() params caps the request message size in bytes and must be an integer JS number (int64 after export); 0 keeps the default. Strings and non-integer numbers fail with 'invalid maxSendSize value ... needs to be an integer'.","triggerScenarios":"connect(addr, { maxSendSize: '1024' }); { maxSendSize: 1.5 }; quoted numbers coming from JSON/YAML config.","commonSituations":"Sending large request payloads (blobs, batched messages) and raising limits from config files that stringify values.","solutions":["Pass an integer number of bytes: 4194304","parseInt env/config strings before passing","Remember 0 means no explicit limit"],"exampleFix":"// before\nclient.connect(addr, { maxSendSize: '4194304' });\n\n// after\nclient.connect(addr, { maxSendSize: 4194304 });","handlingStrategy":"validation","validationCode":"if (connectParams.maxSendSize !== undefined &&\n    !(typeof connectParams.maxSendSize === 'number' && Number.isInteger(connectParams.maxSendSize))) {\n  throw new Error(`maxSendSize must be an integer, got ${connectParams.maxSendSize}`);\n}\nclient.connect(addr, connectParams);","typeGuard":"function isByteSize(v) {\n  return typeof v === 'number' && Number.isInteger(v) && v >= 0;\n}","tryCatchPattern":null,"preventionTips":["Pass raw byte counts as integer literals","parseInt size strings from config before passing","Remember 0 means no explicit limit"],"tags":["grpc","connect","size-limits","type-error"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}