Coder Social home page Coder Social logo

Comments (6)

mokaddem avatar mokaddem commented on August 25, 2024

This is interesting...
According to https://github.com/andymccurdy/redis-py#zincrby , they swapped the value and the amount.
I'll soon update the code to support redis-py-3.x.
In the mean time, you could quick fix this with the following command:

pip install --force-reinstall redis==2.10.6

from misp-dashboard.

littl3field avatar littl3field commented on August 25, 2024

Hey @mokaddem,

I tried this, worked initially, then crashed with the error:

File "./zmq_dispatcher.py", line 299, in
main(args.sleeptime)
File "./zmq_dispatcher.py", line 274, in main
process_log(zmqName, content)
File "./zmq_dispatcher.py", line 256, in process_log
dico_action[topic](zmq_name, jsonevent)
File "./zmq_dispatcher.py", line 101, in handler_dispatcher
handler_event(zmq_name, jsonObj)
File "./zmq_dispatcher.py", line 184, in handler_event
handler_attribute(zmq_name, jsoncopy)
File "./zmq_dispatcher.py", line 230, in handler_attribute
geo_helper.getCoordFromIpAndPublish(jsonattr['value'], jsonattr['category'])
File "/var/www/MISP/tools/misp-dashboard/helpers/geo_helper.py", line 113, in getCoordFromIpAndPublish
self.push_to_redis_geo(self.keyCategRad, coord['lon'], coord['lat'], json.dumps(ordDic))
File "/var/www/MISP/tools/misp-dashboard/helpers/geo_helper.py", line 184, in push_to_redis_geo
self.serv_redis_db.geoadd(keyname, lon, lat, content)
File "/var/www/MISP/tools/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/client.py", line 2121, in geoadd
return self.execute_command('GEOADD', name, *values)
File "/var/www/MISP/tools/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/client.py", line 668, in execute_command
return self.parse_response(connection, command_name, **options)
File "/var/www/MISP/tools/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/client.py", line 680, in parse_response
response = connection.read_response()
File "/var/www/MISP/tools/misp-dashboard/DASHENV/lib/python3.5/site-packages/redis/connection.py", line 629, in read_response
raise response
redis.exceptions.ResponseError: unknown command 'GEOADD'

Rather than using:

pip install --force-reinstall redis==2.10.6

Using pip3 seemed to work:

pip3 install --force-reinstall redis==2.10.6

Will let you know if I see any more errors.

from misp-dashboard.

shaykster avatar shaykster commented on August 25, 2024

Still get the following error;

(DASHENV) misp@misp:/misp-dashboard-master$ ./zmq_dispatcher.py &
[2] 8952
(DASHENV) misp@misp:
/misp-dashboard-master$ Traceback (most recent call last):
File "./zmq_dispatcher.py", line 299, in
main(args.sleeptime)
File "./zmq_dispatcher.py", line 274, in main
process_log(zmqName, content)
File "./zmq_dispatcher.py", line 256, in process_log
dico_action[topic](zmq_name, jsonevent)
File "./zmq_dispatcher.py", line 168, in handler_event
trendings_helper.addTrendingEvent(eventName, timestamp)
File "/home/misp/misp-dashboard-master/helpers/trendings_helper.py", line 47, in addTrendingEvent
self.addGenericTrending(self.keyEvent, eventName, timestamp)
File "/home/misp/misp-dashboard-master/helpers/trendings_helper.py", line 43, in addGenericTrending
self.serv_redis_db.zincrby(keyname, to_save, 1)
File "/home/misp/misp-dashboard-master/DASHENV/lib/python3.6/site-packages/redis/client.py", line 2281, in zincrby
return self.execute_command('ZINCRBY', name, amount, value)
File "/home/misp/misp-dashboard-master/DASHENV/lib/python3.6/site-packages/redis/client.py", line 755, in execute_command
return self.parse_response(connection, command_name, **options)
File "/home/misp/misp-dashboard-master/DASHENV/lib/python3.6/site-packages/redis/client.py", line 768, in parse_response
response = connection.read_response()
File "/home/misp/misp-dashboard-master/DASHENV/lib/python3.6/site-packages/redis/connection.py", line 638, in read_response
raise response
redis.exceptions.ResponseError: value is not a valid float

from misp-dashboard.

mokaddem avatar mokaddem commented on August 25, 2024

Hello @rylittlefield rylittlefield, the error you are referencing:

line 629, in read_response
raise response
redis.exceptions.ResponseError: unknown command 'GEOADD

has been addressed in the issue #1.
Can you please update your redis server and see if it works?

from misp-dashboard.

mokaddem avatar mokaddem commented on August 25, 2024

Hello @shaykster ,

line 638, in read_response
raise response
redis.exceptions.ResponseError: value is not a valid float

I can see that you still have redis-py version 3.x. Please use the redis==2.10.6 as @rylittlefield did until a clean fix has been pushed.
Thanks!

from misp-dashboard.

SteveClement avatar SteveClement commented on August 25, 2024

I can confirm that the temporary downgrade to redis-2.10.6 seems to work.

Please open a new issue if you have another problem related to redis-2.x

Also, make sure your virtualenv is where you updated redis.

e.g:

cd /var/www/misp-dashboard
sudo ./DASHENV/bin/pip freeze |grep redis
redis==2.10.6

In case it is NOT redis 2.10.6, do the following and restart the zmq_dispatcher.py script.

cd /var/www/misp-dashboard
sudo ./DASHENV/bin/pip install --force-reinstall redis==2.10.6

from misp-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.