Project

General

Profile

Actions

Bug #6156

closed

Enricher GeoipEnricherPlugin crashes on nonexistent GeoIP file

Added by Pavel Kácha about 4 years ago. Updated about 4 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Development - Core
Target version:
Start date:
01/02/2020
Due date:
% Done:

0%

Estimated time:
To be discussed:
Yes

Description

... which causes Enricher NOT start.

It should rather yell somewhere visible and pass gracefully.

It probably was the intent, however masked exception probably seems to trigger cleanup without meeting its expectations (missing filehandle?).

2020-01-02 10:03:18,209 INFO: Module 'mentat-enricher.py': Launching instance '3'
2020-01-02 10:03:18,211 INFO: Module 'mentat-enricher.py': Waiting for worker process '60845'
2020-01-02 10:03:18,212 INFO: Module 'mentat-enricher.py': Worker process '60845' ready, executing command 'mentat-enricher.py' with arguments '['mentat-enricher.py', '--paralel']'
Traceback (most recent call last):
  File "/usr/local/bin/mentat-enricher.py", line 66, in <module>
    mentat.module.enricher.MentatEnricherDaemon().run()
  File "/var/mentat/venv/lib/python3.7/site-packages/pyzenkit/baseapp.py", line 1549, in run
    self._stage_setup()
  File "/var/mentat/venv/lib/python3.7/site-packages/pyzenkit/baseapp.py", line 1405, in _stage_setup
    self._sub_stage_setup()
  File "/var/mentat/venv/lib/python3.7/site-packages/pyzenkit/zendaemon.py", line 700, in _sub_stage_setup
    component.setup(self)
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/daemon/component/enricher.py", line 182, in setup
    self._setup_plugins(daemon)
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/daemon/component/enricher.py", line 159, in _setup_plugins
    self._setup_plugin(daemon, plugin_conf)
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/daemon/component/enricher.py", line 147, in _setup_plugin
    plugin.setup(daemon, plugin_conf.get('config', None))
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/plugin/enricher/geoip.py", line 65, in setup
    self.geoip_service = geoip_manager.service()
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/services/geoip.py", line 232, in service
    self._service.setup()
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/services/geoip.py", line 88, in setup
    self.asndb = geoip2.database.Reader(self.fn_asndb)
  File "/var/mentat/venv/lib/python3.7/site-packages/geoip2/database.py", line 86, in __init__
    self._db_reader = maxminddb.open_database(fileish, mode)
  File "/var/mentat/venv/lib/python3.7/site-packages/maxminddb/__init__.py", line 41, in open_database
    return maxminddb.reader.Reader(database, mode)
  File "/var/mentat/venv/lib/python3.7/site-packages/maxminddb/reader.py", line 51, in __init__
    with open(database, 'rb') as db_file:
FileNotFoundError: [Errno 2] No such file or directory: '/var/opt/opensourcedbs/GeoLite2-ASN.mmdb'
Exception ignored in: <function GeoipService.__del__ at 0x7f6d647bbc80>
Traceback (most recent call last):
  File "/var/mentat/venv/lib/python3.7/site-packages/mentat/services/geoip.py", line 77, in __del__
    self.asndb.close()
AttributeError: 'NoneType' object has no attribute 'close'

Related issues

Related to Mentat - Bug #6157: MaxMind changes acces to its free GeoIP dbsClosedJan Mach01/02/2020

Actions
Actions

Also available in: Atom PDF