ratibor78 / geostat

GeoStat, Python script for parsing Nginx and Apache logs files and getting GEO data from incoming IP's.
MIT License
67 stars 20 forks source link

Service is down #11

Closed olegsidokhmetov closed 3 years ago

olegsidokhmetov commented 3 years ago

Helo! After the service starts, it immediately crashes

root@NC-V3:~/geostat# systemctl status geostat.service
● geostat.service - GeoStat
     Loaded: loaded (/lib/systemd/system/geostat.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-11-16 09:13:24 UTC; 11ms ago
   Main PID: 171426 (python)
      Tasks: 1 (limit: 4620)
     Memory: 204.0K
     CGroup: /system.slice/geostat.service
             └─171426 /root/geostat/venv/bin/python geoparser.py

Nov 16 09:13:24 NC-V3 systemd[1]: Started GeoStat.
root@NC-V3:~/geostat# systemctl status geostat.service
● geostat.service - GeoStat
     Loaded: loaded (/lib/systemd/system/geostat.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2020-11-16 09:13:26 UTC; 316ms ago
    Process: 171427 ExecStart=/root/geostat/venv/bin/python geoparser.py (code=exited, status=1/FAILURE)
   Main PID: 171427 (code=exited, status=1/FAILURE)

Nov 16 09:18:47 NC-V3 python[171592]: ModuleNotFoundError: No module named 'geohash' Nov 16 09:18:47 NC-V3 systemd[1]: geostat.service: Main process exited, code=exited, status=1/FAILURE Nov 16 09:18:47 NC-V3 systemd[1]: geostat.service: Failed with result 'exit-code'. Nov 16 09:18:49 NC-V3 systemd[1]: geostat.service: Scheduled restart job, restart counter is at 114777. Nov 16 09:18:49 NC-V3 python[171593]: File "geoparser.py", line 14, in Nov 16 09:18:49 NC-V3 python[171593]: import geohash Nov 16 09:18:49 NC-V3 python[171593]: ModuleNotFoundError: No module named 'geohash' Nov 16 09:18:49 NC-V3 systemd[1]: geostat.service: Main process exited, code=exited, status=1/FAILURE Nov 16 09:18:49 NC-V3 systemd[1]: geostat.service: Failed with result 'exit-code'. Nov 16 09:18:51 NC-V3 systemd[1]: geostat.service: Scheduled restart job, restart counter is at 114778. Nov 16 09:18:51 NC-V3 python[171594]: File "geoparser.py", line 14, in Nov 16 09:18:51 NC-V3 python[171594]: import geohash Nov 16 09:18:51 NC-V3 python[171594]: ModuleNotFoundError: No module named 'geohash' Nov 16 09:18:51 NC-V3 systemd[1]: geostat.service: Main process exited, code=exited, status=1/FAILURE Nov 16 09:18:51 NC-V3 systemd[1]: geostat.service: Failed with result 'exit-code'. Nov 16 09:18:54 NC-V3 systemd[1]: geostat.service: Scheduled restart job, restart counter is at 114779. Nov 16 09:18:54 NC-V3 python[171595]: File "geoparser.py", line 14, in Nov 16 09:18:54 NC-V3 python[171595]: import geohash Nov 16 09:18:54 NC-V3 python[171595]: ModuleNotFoundError: No module named 'geohash' Nov 16 09:18:54 NC-V3 systemd[1]: geostat.service: Main process exited, code=exited, status=1/FAILURE Nov 16 09:18:54 NC-V3 systemd[1]: geostat.service: Failed with result 'exit-code'. Nov 16 09:18:56 NC-V3 systemd[1]: geostat.service: Scheduled restart job, restart counter is at 114780. Nov 16 09:18:56 NC-V3 python[171596]: File "geoparser.py", line 14, in Nov 16 09:18:56 NC-V3 python[171596]: import geohash Nov 16 09:18:56 NC-V3 python[171596]: ModuleNotFoundError: No module named 'geohash' Nov 16 09:18:56 NC-V3 systemd[1]: geostat.service: Main process exited, code=exited, status=1/FAILURE Nov 16 09:18:56 NC-V3 systemd[1]: geostat.service: Failed with result 'exit-code'. root@NC-V3:~/geostat#

olegsidokhmetov commented 3 years ago

Reinstall all, but problem still the same

(venv) root@NC-V3:~/geostat# nano /var/log/syslog

Nov 16 10:49:43 NC-V3 python[1139]: Traceback (most recent call last): Nov 16 10:49:43 NC-V3 python[1139]: File "geoparser.py", line 14, in Nov 16 10:49:43 NC-V3 python[1139]: import Geohash Nov 16 10:49:43 NC-V3 python[1139]: File "/root/geostat/venv/lib/python3.8/site-packages/Geohash/init.py", line 21, in Nov 16 10:49:43 NC-V3 python[1139]: from geohash import decode_exactly, decode, encode Nov 16 10:49:43 NC-V3 python[1139]: ModuleNotFoundError: No module named 'geohash' Nov 16 10:49:43 NC-V3 systemd[1]: geostat.service: Main process exited, code=exited, status=1/FAILURE Nov 16 10:49:43 NC-V3 systemd[1]: geostat.service: Failed with result 'exit-code'. Nov 16 10:49:45 NC-V3 systemd[1]: geostat.service: Scheduled restart job, restart counter is at 20. Nov 16 10:49:45 NC-V3 systemd[1]: Stopped GeoStat. Nov 16 10:49:45 NC-V3 systemd[1]: Started GeoStat. Nov 16 10:49:45 NC-V3 python[1140]: Traceback (most recent call last): Nov 16 10:49:45 NC-V3 python[1140]: File "geoparser.py", line 14, in Nov 16 10:49:45 NC-V3 python[1140]: import Geohash Nov 16 10:49:45 NC-V3 python[1140]: File "/root/geostat/venv/lib/python3.8/site-packages/Geohash/init.py", line 21, in Nov 16 10:49:45 NC-V3 python[1140]: from geohash import decode_exactly, decode, encode Nov 16 10:49:45 NC-V3 python[1140]: ModuleNotFoundError: No module named 'geohash' Nov 16 10:49:45 NC-V3 systemd[1]: geostat.service: Main process exited, code=exited, status=1/FAILURE Nov 16 10:49:45 NC-V3 systemd[1]: geostat.service: Failed with result 'exit-code'.

olegsidokhmetov commented 3 years ago

I think I found solution

https://github.com/vinsci/geohash/issues/4#issue-215358027

Nov 16 11:09:57 NC-V3 systemd[1]: Started GeoStat.
(venv) root@NC-V3:~/geostat# systemctl status geostat.service
● geostat.service - GeoStat
     Loaded: loaded (/lib/systemd/system/geostat.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-11-16 11:09:57 UTC; 20s ago
   Main PID: 1841 (python)
      Tasks: 1 (limit: 4620)
     Memory: 14.7M
     CGroup: /system.slice/geostat.service
             └─1841 /root/geostat/venv/bin/python geoparser.py

Nov 16 11:09:57 NC-V3 systemd[1]: Started GeoStat.
(venv) root@NC-V3:~/geostat# nano geoparser.py
(venv) root@NC-V3:~/geostat# nano venv/lib/python3.8/site-packages/Geohash/__init__.py
(venv) root@NC-V3:~/geostat# systemctl status geostat.service
● geostat.service - GeoStat
     Loaded: loaded (/lib/systemd/system/geostat.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-11-16 11:09:57 UTC; 2min 59s ago
   Main PID: 1841 (python)
      Tasks: 1 (limit: 4620)
     Memory: 15.0M
     CGroup: /system.slice/geostat.service
             └─1841 /root/geostat/venv/bin/python geoparser.py

Nov 16 11:09:57 NC-V3 systemd[1]: Started GeoStat.
(venv) root@NC-V3:~/geostat# systemctl status geostat.service
● geostat.service - GeoStat
     Loaded: loaded (/lib/systemd/system/geostat.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-11-16 11:09:57 UTC; 6min ago
   Main PID: 1841 (python)
      Tasks: 1 (limit: 4620)
     Memory: 15.0M
     CGroup: /system.slice/geostat.service
             └─1841 /root/geostat/venv/bin/python geoparser.py

Service is stable