graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Unable to process message <c3920140-70a2-11ea-a449-9e2895143dd6>: java.util.ConcurrentModificationException

Open Hmemories opened this issue 6 years ago • 2 comments

#7389 ##description I added this file, Geolite2-City.mmdb, and configured the "Geo-Location Processor". But it says "Unable to process message <9fcbd510-70a2-11ea-a449-9e2895143dd6>: java. util. ConcurrentModificationException" in the code. Maybe the problem is from this part of code.

 for (Map.Entry<String, Object> field : message.getFields().entrySet()) {
            final String key = field.getKey();
            if (!key.startsWith(Message.INTERNAL_FIELD_PREFIX)) {
                final Optional<GeoLocationInformation> geoLocationInformation = extractGeoLocationInformation(field.getValue());
                geoLocationInformation.ifPresent(locationInformation -> {
                    // We will store the coordinates as a "lat,long" string
                    message.addField(key + "_geolocation", locationInformation.latitude() + "," + locationInformation.longitude());
                    message.addField(key + "_country_code", locationInformation.countryIsoCode());
                    message.addField(key + "_city_name", locationInformation.cityName());
                });
            }
        }

Hmemories avatar Mar 30 '20 01:03 Hmemories

Hi!

That processor is no longer the recommended way to add geolocation information. Please refer to https://docs.graylog.org/en/3.2/pages/geolocation.html for the recommended way.

What you found is indeed a bug, so I'll leave this report open. Most likely the processor will be deprecated.

Thanks!

kroepke avatar Mar 30 '20 09:03 kroepke

ok,thanks

Hmemories avatar Mar 31 '20 00:03 Hmemories