Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slowlog_get() raises TypeError #1475

Closed
hithwen opened this issue Apr 13, 2021 · 2 comments
Closed

slowlog_get() raises TypeError #1475

hithwen opened this issue Apr 13, 2021 · 2 comments

Comments

@hithwen
Copy link

hithwen commented Apr 13, 2021

Version:
Redis version: 3.2.13
Redis-py version: 3.5.3

Platform: What platform / version?

Python 3.8 on linux

Description:
Similar to #1238 except the error is int found and not str found.

Stacktrace is:

File ".../redisdb.py", line 501, in check
          self._check_slowlog()
        File ".../redisdb.py", line 452, in _check_slowlog
          slowlogs = conn.slowlog_get(max_slow_entries)
        File ".../python3.8/site-packages/redis/client.py", line 1466, in slowlog_get
          return self.execute_command(*args, decode_responses=decode_responses)
        File ".../python3.8/site-packages/redis/client.py", line 901, in execute_command
          return self.parse_response(conn, command_name, **options)
        File ".../python3.8/site-packages/redis/client.py", line 921, in parse_response
          return self.response_callbacks[command_name](response, **options)
        File ".../python3.8/site-packages/redis/client.py", line 415, in parse_slowlog_get
          return [{
        File ".../python3.8/site-packages/redis/client.py", line 419, in <listcomp>
          'command': space.join(item[3])
      TypeError: sequence item 0: expected a bytes-like object, int found

Note that changing decode_responses wont make a difference since it will have the same result if the space is ' ' or b' '

@andymccurdy
Copy link
Contributor

Are the Redis servers running Redis Enterprise from Redis Labs? If so, it's probably related to #1374. FYI, the Redis enterprise version adds additional fields to the slowlog entires but doesn't provide any documentation on how to parse them. See here: #1352 (comment)

@hithwen
Copy link
Author

hithwen commented May 19, 2021

The issue has been fixed on #1352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants