{"record":{"id":"af83882d75eb135e","repo":"fluent/fluentd","slug":"bug-block-must-have-just-one-argument","errorCode":null,"errorMessage":"BUG: block must have just one argument","messagePattern":"BUG: block must have just one argument","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/server.rb","lineNumber":81,"sourceCode":"      #   source_port = conn.remote_port\n      #   conn.data do |data|\n      #     # on data\n      #     conn.write resp # ...\n      #     conn.close\n      #   end\n      # end\n      def server_create_connection(title, port, proto: nil, bind: '0.0.0.0', shared: true, backlog: nil, tls_options: nil, **socket_options, &block)\n        proto ||= (@transport_config && @transport_config.protocol == :tls) ? :tls : :tcp\n\n        raise ArgumentError, \"BUG: title must be a symbol\" unless title && title.is_a?(Symbol)\n        raise ArgumentError, \"BUG: port must be an integer\" unless port && port.is_a?(Integer)\n        raise ArgumentError, \"BUG: invalid protocol name\" unless PROTOCOLS.include?(proto)\n        raise ArgumentError, \"BUG: cannot create connection for UDP\" unless CONNECTION_PROTOCOLS.include?(proto)\n\n        raise ArgumentError, \"BUG: tls_options is available only for tls\" if tls_options && proto != :tls\n\n        raise ArgumentError, \"BUG: block not specified which handles connection\" unless block_given?\n        raise ArgumentError, \"BUG: block must have just one argument\" unless block.arity == 1\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        socket_option_validate!(proto, **socket_options)\n        socket_option_setter = ->(sock){ socket_option_set(sock, **socket_options) }\n\n        case proto\n        when :tcp\n          server = server_create_for_tcp_connection(shared, bind, port, backlog, socket_option_setter, &block)\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","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/server.rb#L63-L99","documentation":"Error \"BUG: block must have just one argument\" thrown in fluent/fluentd.","triggerScenarios":"Thrown at lib/fluent/plugin_helper/server.rb:81 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"}