MISP / misp-dashboard

A live dashboard for a real-time overview of threat intelligence from MISP instances
GNU Affero General Public License v3.0
194 stars 65 forks source link

zmq_subscriber.py crashes repeatedly #1

Closed Andy-Dove closed 7 years ago

Andy-Dove commented 7 years ago

I am receiving the following error when I try and publish some events to ZMQ:

AttributeError: 'StricRedis' object has no attribute 'geoadd'.

This causes the subscriber to terminate. The error appears to occur on any event containing an IP address. Additionally I am getting messages that the subscriber is unable to resolve domains to IPs.

Kind regards Andy Dove

adulau commented 7 years ago

Maybe you are running an old version of the Python redis library (or redis) which is not supporting the geoadd? Could you check the version and upgrade with pip3 to the latest version.

Andy-Dove commented 7 years ago

Thanks for getting back to me. I was using the version supplied with the misp training VM. I have upgraded to the latest version of redis with pip3 and also checked that redis-server is up to date. apt-get reports version 2:3.0.6-1. Instead of the previous error I am now receiving a different one:

File "/usr/local/lib/python3.5/dist-packages/redis/connection.py", line 629, in read_response raise response redis.exceptions.ResponseError: unknown command 'GEOADD'

If I logon to the redis server manuallyit also tells me the command is not recognised. Clearly this is a redis issue not a dashboard issue. Feel free to close the issue but any guidance would be welcome.

Many thanks Andy Dove

adulau commented 7 years ago

Interesting I didn't test the training VM ;-) We will have a look too.

Andy-Dove commented 7 years ago

Manually upgrading redis to version 4 seems to have fixed the problem on the VM. Just need to work out how to manually make the upgrade stick as make install isn't doing the job.

cudeso commented 7 years ago

I had the same issue. Starting from Ubuntu 16. Uncommenting "serv_redis_db.geoadd(keyname, lon, lat, content)" in def push_to_redis_geo avoids the crashes. It seems that the script does not call "./DASHENV/lib/python3.5/site-packages/redis/client.py" (which contains the "def geoadd()" but uses "/usr/lib/python3/dist-packages/redis/client.py" (which does not contain the geoadd) code.

Andy-Dove commented 7 years ago

Ungrading the Redis and the associated python library definitely fixed the issue for me. I had to run the server install script from the redis distribution in order to finish upgrading the redis server but once that was done its all working smoothly.