{"record":{"id":"8d3e9cb885d7a0f8","repo":"grafana/k6","slug":"invalid-reflectmetadata-param-w","errorCode":null,"errorMessage":"invalid reflectMetadata param: %w","messagePattern":"invalid reflectMetadata param: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/grpc/params.go","lineNumber":180,"sourceCode":"\t\t\tif !ok {\n\t\t\t\treturn result, fmt.Errorf(\"invalid plaintext value: '%#v', it needs to be boolean\", v)\n\t\t\t}\n\t\tcase \"timeout\":\n\t\t\tvar err error\n\t\t\tresult.Timeout, err = types.GetDurationValue(v)\n\t\t\tif err != nil {\n\t\t\t\treturn result, fmt.Errorf(\"invalid timeout value: %w\", err)\n\t\t\t}\n\t\tcase \"reflect\":\n\t\t\tvar ok bool\n\t\t\tresult.UseReflectionProtocol, ok = v.(bool)\n\t\t\tif !ok {\n\t\t\t\treturn result, fmt.Errorf(\"invalid reflect value: '%#v', it needs to be boolean\", v)\n\t\t\t}\n\t\tcase \"reflectMetadata\":\n\t\t\tmd, err := newMetadata(params.Get(k))\n\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}","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/grpc/params.go#L162-L198","documentation":"Raised in newConnectParams when the 'reflectMetadata' option of grpc.connect fails newMetadata conversion — must be an object of string-to-string (or '-bin' to binary) pairs; the wrapped error gives specifics.","triggerScenarios":"Thrown at internal/js/modules/k6/grpc/params.go:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass reflectMetadata as a plain object of string keys to string values","Use '-bin' keys with byte arrays for binary metadata","Check the wrapped error for the failing entry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}