vdcloudcraft / fail2ban-geo-exporter

A Prometheus.io exporter that geotags your jailed IPs
MIT License
18 stars 7 forks source link

KeyError: 'city' #16

Open dimitrimestdag opened 3 years ago

dimitrimestdag commented 3 years ago

Hello, What is this error? The exporter was working fine and suddenly he made this mistake, not possible to find out why

` Traceback (most recent call last):

File "./fail2ban-exporter.py", line 127, in <module>

REGISTRY.register(F2bCollector(conf))

File "/usr/local/lib/python3.8/site-packages/prometheus_client/registry.py", line 24, in register

names = self._get_names(collector)

File "/usr/local/lib/python3.8/site-packages/prometheus_client/registry.py", line 64, in _get_names

for metric in desc_func():

File "./fail2ban-exporter.py", line 80, in collect

yield self.expose_grouped()

File "./fail2ban-exporter.py", line 107, in expose_grouped

location_key = tuple([ entry[x] for x in self.extra_labels ])

File "./fail2ban-exporter.py", line 107, in <listcomp>

location_key = tuple([ entry[x] for x in self.extra_labels ])

KeyError: 'city'

`

Thanks for your help

Dimo

Kontr3X commented 2 years ago

This issue belongs to: https://github.com/vdcloudcraft/fail2ban-geo-exporter/issues/19