ip2location / logstash-filter-ip2location

IP2Location filter plugin for Logstash enables Logstash's users to add geolocation information such as country, state, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection speed, IDD code, area code, weather station code, weather station name, MNC, MCC, mobile brand, elevation and usage type by IP address.
https://www.ip2location.com
Other
20 stars 5 forks source link

"wrong number of arguments (1 for 3)" error #15

Closed youngmip closed 4 years ago

youngmip commented 5 years ago

Hi,

I am running a Logstash instance with ip2location filter and sometimes the Logstash process has stopped reporting this error: [2018-12-21T07:00:19,167][ERROR][logstash.pipeline ] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {:pipeline_id=>"main", "exception"=>"wrong number of arguments (1 for 3)", "backtrace"=>["/xxx/tools/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:125:in block in find'", "org/jruby/ext/thread/Mutex.java:148:insynchronize'", "/xxx/tools/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:158:in synchronize'", "/xxx/tools/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:123:infind'", "/xxx/tools/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:52:in filter'", "/xxx/tools/logstash/logstash-core/lib/logstash/filters/base.rb:145:indo_filter'", "/xxx/tools/logstash/logstash-core/lib/logstash/filters/base.rb:164:in block in multi_filter'", "org/jruby/RubyArray.java:1734:ineach'", "/xxx/tools/logstash/logstash-core/lib/logstash/filters/base.rb:161:in multi_filter'", "/xxx/tools/logstash/logstash-core/lib/logstash/filter_delegator.rb:44:inmulti_filter'", "(eval):730:in block in filter_func'", "/xxx/logstash/logstash-core/lib/logstash/pipeline.rb:443:infilter_batch'", "/xxx/tools/logstash/logstash-core/lib/logstash/pipeline.rb:422:in worker_loop'", "/xxx/tools/logstash/logstash-core/lib/logstash/pipeline.rb:384:inblock in start_workers'"], :thread=>"#"}

The version of Logstash is 6.3.0.

Thanks for any help in advance. Youngmi

siam28 commented 5 years ago

I am also getting this error.

ip2location commented 5 years ago

Hi @siam28 @youngmip

Could you send us the error details to support@ip2location.com to ease our investigation?

Thank you.

siam28 commented 5 years ago

Here are the log messages when logstash crashes:

[2019-06-24T02:33:01,477][ERROR][logstash.pipeline        ] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {:pipeline_id=>"main", "exception"=>"wrong number of arguments (given 1, expected 3)", "backtrace"=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:125:in `block in find'", "org/jruby/ext/thread/Mutex.java:165:in `synchronize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:158:in `synchronize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:123:in `find'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:52:in `filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:143:in `do_filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:162:in `block in multi_filter'", "org/jruby/RubyArray.java:1792:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:159:in `multi_filter'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:115:in `multi_filter'", "(eval):5161:in `block in initialize'", "org/jruby/RubyArray.java:1792:in `each'", "(eval):5157:in `block in initialize'", "(eval):5258:in `block in initialize'", "org/jruby/RubyArray.java:1792:in `each'", "(eval):5251:in `block in initialize'", "(eval):1171:in `block in filter_func'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:358:in `filter_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:337:in `worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:304:in `block in start_workers'"], :thread=>"#<Thread:0x7f9f9670 sleep>"}
[2019-06-24T02:33:01,474][ERROR][logstash.pipeline        ] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {:pipeline_id=>"main", "exception"=>"wrong number of arguments (given 1, expected 3)", "backtrace"=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:125:in `block in find'", "org/jruby/ext/thread/Mutex.java:165:in `synchronize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:158:in `synchronize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:123:in `find'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:52:in `filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:143:in `do_filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:162:in `block in multi_filter'", "org/jruby/RubyArray.java:1792:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:159:in `multi_filter'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:115:in `multi_filter'", "(eval):5161:in `block in initialize'", "org/jruby/RubyArray.java:1792:in `each'", "(eval):5157:in `block in initialize'", "(eval):5258:in `block in initialize'", "org/jruby/RubyArray.java:1792:in `each'", "(eval):5251:in `block in initialize'", "(eval):1171:in `block in filter_func'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:358:in `filter_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:337:in `worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:304:in `block in start_workers'"], :thread=>"#<Thread:0x7f9f9670 sleep>"}
[2019-06-24T02:33:01,785][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#<ArgumentError: wrong number of arguments (given 1, expected 3)>, :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:125:in `block in find'", "org/jruby/ext/thread/Mutex.java:165:in `synchronize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:158:in `synchronize'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:123:in `find'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-ip2location-2.0.2/lib/logstash/filters/ip2location.rb:52:in `filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:143:in `do_filter'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:162:in `block in multi_filter'", "org/jruby/RubyArray.java:1792:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:159:in `multi_filter'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:115:in `multi_filter'", "(eval):5161:in `block in initialize'", "org/jruby/RubyArray.java:1792:in `each'", "(eval):5157:in `block in initialize'", "(eval):5258:in `block in initialize'", "org/jruby/RubyArray.java:1792:in `each'", "(eval):5251:in `block in initialize'", "(eval):1171:in `block in filter_func'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:358:in `filter_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:337:in `worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:304:in `block in start_workers'"]}

I am using logstash 6.8.0. Let me know if you need any additional information.

ip2location commented 5 years ago

Hi @siam28

Can you please email us the details of your logstash environment and the source of your data (where the IP data located) to support@ip2location.com ? So that we can provide the email support easily.

ip2location commented 5 years ago

Hi @siam28 @youngmip

Can you please show us your config file?

ip2location commented 4 years ago

Hi @youngmip @siam28

Can you run this logstash-plugin update logstash-filter-ip2location command and test it again?

Please make sure the version of logstash-filter-ip2location is updated to v2.1.1