{"record":{"id":"bc94b18195e8e542","repo":"jaegertracing/jaeger","slug":"max-recv-msg-size-mib-must-be-between-0-and-d-go","errorCode":null,"errorMessage":"max_recv_msg_size_mib must be between 0 and %d, got %d","messagePattern":"max_recv_msg_size_mib must be between 0 and (.+?), got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/v2/grpc/factory.go","lineNumber":126,"sourceCode":"\t\tLogger:         telset.Logger,\n\t\tTracerProvider: tracerProvider,\n\t\tMeterProvider:  telset.MeterProvider,\n\t}\n}\n\ntype newClientFn func(telset component.TelemetrySettings, gcs *configgrpc.ClientConfig, opts ...grpc.DialOption) (*grpc.ClientConn, error)\n\nfunc (f *Factory) initializeConnections(\n\treaderTelset, writerTelset component.TelemetrySettings,\n\treaderConfig, writerConfig *configgrpc.ClientConfig,\n\tnewClient newClientFn,\n) error {\n\tif f.config.Auth.HasValue() {\n\t\treturn errors.New(\"authenticator is not supported\")\n\t}\n\tconst maxRecvMsgSizeMiB = math.MaxInt / (1024 * 1024)\n\tif f.config.MaxRecvMsgSizeMiB < 0 || f.config.MaxRecvMsgSizeMiB > maxRecvMsgSizeMiB {\n\t\treturn fmt.Errorf(\"max_recv_msg_size_mib must be between 0 and %d, got %d\", maxRecvMsgSizeMiB, f.config.MaxRecvMsgSizeMiB)\n\t}\n\n\tunaryInterceptors := []grpc.UnaryClientInterceptor{bearertoken.NewUnaryClientInterceptor()}\n\tstreamInterceptors := []grpc.StreamClientInterceptor{bearertoken.NewStreamClientInterceptor()}\n\n\tif tenancyMgr := tenancy.NewManager(&f.config.Tenancy); tenancyMgr.Enabled {\n\t\tunaryInterceptors = append(unaryInterceptors, tenancy.NewClientUnaryInterceptor(tenancyMgr))\n\t\tstreamInterceptors = append(streamInterceptors, tenancy.NewClientStreamInterceptor(tenancyMgr))\n\t}\n\n\t// HeaderForwarding acts as an enable switch: header capture happens on the query\n\t// server side (HTTP/gRPC server interceptors); the client interceptors here simply\n\t// forward whatever was captured into outgoing metadata.\n\tif len(f.config.HeaderForwarding) > 0 {\n\t\tunaryInterceptors = append(unaryInterceptors, headerforwarding.NewUnaryClientInterceptor())\n\t\tstreamInterceptors = append(streamInterceptors, headerforwarding.NewStreamClientInterceptor())\n\t}\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/jaegertracing/jaeger/blob/806f4447841ecdb60519f408b004a599d515f437/internal/storage/v2/grpc/factory.go#L108-L144","documentation":"The gRPC storage factory validates MaxRecvMsgSizeMiB at startup: it must be within [0, MaxInt/1MiB]. Values outside this range would overflow the int-typed byte computation passed to grpc.WithDefaultCallOptions, so the factory refuses to initialize.","triggerScenarios":"Setting max_recv_msg_size_mib to a negative number or a value exceeding math.MaxInt/(1024*1024) (2147483647 on 64-bit) in the gRPC storage config, during NewFactory -> initializeConnections.","commonSituations":"Typo in YAML (e.g. -1); attempting to set an absurdly large receive limit without unit awareness; config generated programmatically with unbounded values.","solutions":["Set max_recv_msg_size_mib to a sane positive value (e.g. 4-64 MiB)","Confirm the config unit is MiB, not bytes — do not enter byte-sized numbers","Fix config generation/template code producing negative or huge values"],"exampleFix":"// before (config)\nmax_recv_msg_size_mib: -1\n// after\nmax_recv_msg_size_mib: 16","handlingStrategy":"validation","validationCode":"const maxRecvMsgSizeMiB = math.MaxInt / (1024 * 1024)\nif cfg.MaxRecvMsgSizeMiB < 0 || cfg.MaxRecvMsgSizeMiB > maxRecvMsgSizeMiB {\n    return fmt.Errorf(\"max_recv_msg_size_mib out of range: %d\", cfg.MaxRecvMsgSizeMiB)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep values in a sane range (4-128 MiB)","Validate config before deploying","Remember the unit is MiB, not bytes"],"tags":["grpc","configuration","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"806f4447841ecdb60519f408b004a599d515f437","analyzedAt":"2026-09-01T02:39:22.140Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}