bitcart/bitcart

[BUG] Worker raises: aioredis.exceptions.ResponseError: wrong number of arguments for 'hset' command

surfer190 opened this issue · 4 comments

Describe the bug

Running the worker python worker.py raises an exception: aioredis.exceptions.ResponseError: wrong number of arguments for 'hset' command

(env) stephen@web:/var/www/bitcart$ python worker.py 
2022-08-04 21:01:54,133 - [PID 23060] - api.settings.log_startup_info [line 229] - INFO - BitcartCC version: 0.6.8.1 - https://bitcartcc.com - https://github.com/bitcartcc/bitcart
2022-08-04 21:01:54,142 - [PID 23060] - api.settings.log_startup_info [line 230] - INFO - Python version: 3.9.9 (main, Jan 11 2022, 09:25:52) 
[GCC 6.3.0 20170516]. On platform: Linux-4.9.0-19-amd64-x86_64-with-glibc2.24
2022-08-04 21:01:54,143 - [PID 23060] - api.settings.log_startup_info [line 231] - INFO - BITCART_CRYPTOS=btc; IN_DOCKER=False; LOG_FILE=None
2022-08-04 21:01:54,143 - [PID 23060] - api.settings.log_startup_info [line 235] - INFO - Successfully loaded 1 cryptos
2022-08-04 21:01:54,143 - [PID 23060] - api.settings.log_startup_info [line 236] - INFO - 17 notification providers available
2022-08-04 21:01:54,150 - [PID 23060] - api.settings.internal_error_handler [line 213] - ERROR - 
Traceback (most recent call last):
  File "/var/www/bitcart/worker.py", line 78, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/var/www/bitcart/worker.py", line 45, in main
    await tor_ext.refresh(log=False)  # to pre-load data for initial requests
  File "/var/www/bitcart/api/ext/tor.py", line 112, in refresh
    await settings.settings.redis_pool.hset(
  File "/var/www/bitcart/env/lib/python3.9/site-packages/aioredis/client.py", line 1085, in execute_command
    return await self.parse_response(conn, command_name, **options)
  File "/var/www/bitcart/env/lib/python3.9/site-packages/aioredis/client.py", line 1101, in parse_response
    response = await connection.read_response()
  File "/var/www/bitcart/env/lib/python3.9/site-packages/aioredis/connection.py", line 919, in read_response
    raise response from None
aioredis.exceptions.ResponseError: wrong number of arguments for 'hset' command

Traceback (most recent call last):
  File "/var/www/bitcart/worker.py", line 78, in <module>
    asyncio.run(main())
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/var/www/bitcart/worker.py", line 45, in main
    await tor_ext.refresh(log=False)  # to pre-load data for initial requests
  File "/var/www/bitcart/api/ext/tor.py", line 112, in refresh
    await settings.settings.redis_pool.hset(
  File "/var/www/bitcart/env/lib/python3.9/site-packages/aioredis/client.py", line 1085, in execute_command
    return await self.parse_response(conn, command_name, **options)
  File "/var/www/bitcart/env/lib/python3.9/site-packages/aioredis/client.py", line 1101, in parse_response
    response = await connection.read_response()
  File "/var/www/bitcart/env/lib/python3.9/site-packages/aioredis/connection.py", line 919, in read_response
    raise response from None
aioredis.exceptions.ResponseError: wrong number of arguments for 'hset' command

To Reproduce
Steps to reproduce the behavior:

  1. Follow the manual deployment steps
  2. Run python3 worker.py

Expected behavior

Expect the worker to run and not raise an exception

Environment (please complete the following information):

  • OS: Debian GNU/Linux 9.13 (stretch)
    
  • Bitcart version: Version 0.6.8.1
    
  • yarn --version: 3.2.2
    
  • npm -v: 8.5.5
    
  • nodejs -v: v17.9.0
    

Hmm, did you install all dependencies correctly? How did you do that exactly? Also what is your redis server version? It might be too old

I Installed the requirements as per the manual:

$ pip freeze | grep redis
aioredis==2.0.1
hiredis==2.0.0

$ redis-server -v
Redis server v=3.2.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=d35edfdcb5ba8661

$ redis-cli -v
redis-cli 3.2.6

Yeah, redis 3 is too old. I think at least redis 5 is needed

Understood. I updated to version 5 and python worker.py is working.
Thank you for the assistance.