{"record":{"id":"65d1d0dbe69eaff6","repo":"fluent/fluentd","slug":"bug-max-bytes-is-available-only-for-udp","errorCode":null,"errorMessage":"BUG: max_bytes is available only for udp","messagePattern":"BUG: max_bytes is available only for udp","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/server.rb","lineNumber":152,"sourceCode":"        raise ArgumentError, \"BUG: block not specified which handles received data\" unless block_given?\n        raise ArgumentError, \"BUG: block must have 1 or 2 arguments\" unless callback.arity == 1 || callback.arity == 2\n\n        if proto == :tcp || proto == :tls\n          socket_options[:linger_timeout] ||= @transport_config&.linger_timeout || 0\n        end\n\n        socket_options[:receive_buffer_size] ||= @transport_config&.receive_buffer_size\n\n        unless socket\n          socket_option_validate!(proto, **socket_options)\n          socket_option_setter = ->(sock){ socket_option_set(sock, **socket_options) }\n        end\n\n        if proto != :tcp && proto != :tls && proto != :unix # options to listen/accept connections\n          raise ArgumentError, \"BUG: backlog is available for tcp/tls\" if backlog\n        end\n        if proto != :udp # UDP options\n          raise ArgumentError, \"BUG: max_bytes is available only for udp\" if max_bytes\n          raise ArgumentError, \"BUG: flags is available only for udp\" if flags != 0\n        end\n\n        case proto\n        when :tcp\n          server = server_create_for_tcp_connection(shared, bind, port, backlog, socket_option_setter) do |conn|\n            conn.data(&callback)\n          end\n        when :tls\n          transport_config = if tls_options\n                               server_create_transport_section_object(tls_options)\n                             elsif @transport_config && @transport_config.protocol == :tls\n                               @transport_config\n                             else\n                               raise ArgumentError, \"BUG: TLS transport specified, but certification options are not specified\"\n                             end\n          server = server_create_for_tls_connection(shared, bind, port, transport_config, backlog, socket_option_setter) do |conn|\n            conn.data(&callback)","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/server.rb#L134-L170","documentation":"Error \"BUG: max_bytes is available only for udp\" thrown in fluent/fluentd.","triggerScenarios":"Thrown at lib/fluent/plugin_helper/server.rb:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}