rq / rq-scheduler

A lightweight library that adds job scheduling capabilities to RQ (Redis Queue)
MIT License
1.45k stars 230 forks source link

Run rqscheduler error with redis connection parameter decode_response=True #204

Open cw1427 opened 5 years ago

cw1427 commented 5 years ago

When I used a redis connection with decode_response=True to the rq-scheduler, run the rqscheduler command, will got below error.

"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 1: invalid start byte"

Python version=3.6 Redis=3.2 hredis=1.0 rq-scheduler=0.9

File "/usr/local/lib/python3.6/site-packages/rq_scheduler/scheduler.py", line 389, in enqueue_jobs for job in jobs: File "/usr/local/lib/python3.6/site-packages/rq_scheduler/scheduler.py", line 318, in get_jobs job = self.job_class.fetch(job_id, connection=self.connection) File "/usr/local/lib/python3.6/site-packages/rq/job.py", line 287, in fetch job.refresh() File "/usr/local/lib/python3.6/site-packages/rq/job.py", line 404, in refresh obj = self.connection.hgetall(key) File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 2649, in hgetall return self.execute_command('HGETALL', name) File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 775, in execute_command return self.parse_response(connection, command_name, **options) File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 789, in parse_response response = connection.read_response() File "/usr/local/lib/python3.6/site-packages/redis/sentinel.py", line 56, in read_response return super(SentinelManagedConnection, self).read_response() File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 637, in read_response response = self._parser.read_response() File "/usr/local/lib/python3.6/site-packages/redis/connection.py", line 414, in read_response response = self._reader.gets() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9c in position 1: invalid start byte /ats # cd /usr/local/lib/python3.6/site-packages/

selwin commented 5 years ago

Could you please open a PR for this?

hbrannan commented 3 years ago

Also had this issue.

prajgujarathi commented 3 years ago

Having the same issue. Is it fixed?