ail-framework icon indicating copy to clipboard operation
ail-framework copied to clipboard

redis.exceptions.DataError: A tuple item must be str, int, float or bytes.

Open sudeepbogati7 opened this issue 1 year ago • 2 comments

While running :

/ail-framework/bin/crawlers/Crawler.py

Does this error related to lacus ?

Traceback (most recent call last):
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/connection.py", line 78, in pack
    output.append(hiredis.pack_command(args))
TypeError: A tuple item must be str, int, float or bytes.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./Crawler.py", line 282, in <module>
    module = Crawler()
  File "./Crawler.py", line 46, in __init__
    crawlers.reload_crawler_captures()
  File "/root/ail-framework/bin/lib/crawlers.py", line 1015, in reload_crawler_captures
    capture.update(None)
  File "/root/ail-framework/bin/lib/crawlers.py", line 1071, in update
    r_cache.hset(f'crawler:capture:{self.uuid}', 'status', CaptureStatus.UNKNOWN)
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/commands/core.py", line 5045, in hset
    return self.execute_command("HSET", name, *pieces)
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/client.py", line 559, in execute_command
    return self._execute_command(*args, **options)
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/client.py", line 567, in _execute_command
    return conn.retry.call_with_retry(
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/client.py", line 568, in <lambda>
    lambda: self._send_command_parse_response(
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/client.py", line 541, in _send_command_parse_response
    conn.send_command(*args, **options)
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/connection.py", line 557, in send_command
    self._command_packer.pack(*args),
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/connection.py", line 81, in pack
    raise DataError(value).with_traceback(traceback)
  File "/root/ail-framework/AILENV/lib/python3.8/site-packages/redis/connection.py", line 78, in pack
    output.append(hiredis.pack_command(args))
redis.exceptions.DataError: A tuple item must be str, int, float or bytes.

sudeepbogati7 avatar Oct 29 '24 05:10 sudeepbogati7

@adulau @Rafiot @cudeso @rommelfs

sudeepbogati7 avatar Nov 05 '24 07:11 sudeepbogati7

That's a weird issue, generally means that one of the value added to redis is None, but that doesn't makes much sense there on the call r_cache.hset(f'crawler:capture:{self.uuid}', 'status', CaptureStatus.UNKNOWN).

Having a quick look at the code makes me think that you're either using an old version of the project, or that the script was still running on that old version of the code when it crashed.

@Terrtia any idea?

Rafiot avatar Nov 05 '24 09:11 Rafiot