Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid attempt to open a GeoIP2-Country database using the city method #103

Open
deamen opened this issue Dec 12, 2016 · 3 comments
Open

Comments

@deamen
Copy link

deamen commented Dec 12, 2016

I am getting the "Invalid attempt to open a GeoIP2-Country database using the city method" error message while using country database with logstash 5.1.2 and logstash-filter-geoip-4.0.3-java.

The filter configuration I am using:
geoip { add_tag => [ "GeoIP" ] database => "/opt/logstash/vendor/GeoCity/GeoIP2-Country.mmdb" source => "clientip" }

The database is opened without any issue, but once the logs come in, I get the following error messages and logstash stops working.

[2016-12-11T18:43:47,063][ERROR][logstash.filters.geoip   ] Unknown error while looking up GeoIP data {:exception=>java.lang.UnsupportedOperationException: Invalid attempt to open a GeoIP2-Country database using the city method, :field=>"clientip", :event=>2016-12-09T17:30:00.000Z 192.168.99.10 192.168.17.9 - - [10/Dec/2016:04:30:00 +1100] "GET /Javascript/TOL_Javascript.js HTTP/1.1" 200 7036 "-" "libwww-perl/6.02" "-" (user.toltest.om.net -> 192.168.17.31:80) 0.001 0.001 }
[2016-12-11T18:43:47,066][ERROR][logstash.pipeline        ] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {"exception"=>java.lang.UnsupportedOperationException: Invalid attempt to open a GeoIP2-Country database using the city method, "backtrace"=>["com.maxmind.geoip2.DatabaseReader.get(com/maxmind/geoip2/DatabaseReader.java:150)", "com.maxmind.geoip2.DatabaseReader.city(com/maxmind/geoip2/DatabaseReader.java:217)", "java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)", "RUBY.filter(/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-geoip-4.0.3-java/lib/logstash/filters/geoip.rb:160)", "RUBY.multi_filter(/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:156)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)", "RUBY.multi_filter(/usr/share/logstash/logstash-core/lib/logstash/filters/base.rb:153)", "RUBY.multi_filter(/usr/share/logstash/logstash-core/lib/logstash/filter_delegator.rb:41)", "RUBY.initialize((eval):9001)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)", "RUBY.initialize((eval):8995)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:281)", "RUBY.filter_func((eval):1794)", "RUBY.filter_batch(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:260)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:281)", "RUBY.each(/usr/share/logstash/logstash-core/lib/logstash/util/wrapped_synchronous_queue.rb:186)", "org.jruby.RubyHash.each(org/jruby/RubyHash.java:1342)", "RUBY.each(/usr/share/logstash/logstash-core/lib/logstash/util/wrapped_synchronous_queue.rb:185)", "RUBY.filter_batch(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:258)", "RUBY.worker_loop(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:246)", "RUBY.start_workers(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:225)", "java.lang.Thread.run(java/lang/Thread.java:745)"]}

Looking into the code, the codes(which set geoip_type accordingly) to detect which database edition is in use was removed in commit a0ef0d3

@pemontto
Copy link

pemontto commented Jun 1, 2017

👍

1 similar comment
@VersBinarii
Copy link

+1

@volter
Copy link
Contributor

volter commented Jan 22, 2019

It's worth saying that the documentation tells you that only ASN and country are supported: https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants