redis.exceptions.DataError:类型输入无效:“NoneType”。先转换为字节、字符串或数字

fur*_*eko 10 redis plotly plotly-dash

我最近开始使用 Redis 和 RQ 来运行后台进程。我构建了一个 Dash 应用程序,它在 Heroku 上运行良好,并且过去也可以在本地运行。最近,我尝试再次在本地测试同一个应用程序,但不断收到以下错误 - 尽管我使用的是 Heroku 上托管的完全相同的代码:

redis.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a byte, string or number first.
Run Code Online (Sandbox Code Playgroud)

在我的requirements.txt和Ubuntu 18.04上的虚拟环境中,我有redis v.3.0.1,rq 0.13.0

当我在终端上运行 redis-server 时,我看到使用了 Redis 4.0.9(这也让我感到困惑)。

我尝试谷歌搜索两天寻找解决方案,但没有成功。

有谁知道可能发生了什么以及如何解决这个错误?

这是完整的相关回溯:

File "/home/tom/dashenv/pb101_models/pages/cumulative_culture.py", line 1026, in stop_or_start_update
  job = q.fetch_job(job_id)
File "/home/tom/dashenv/dash/lib/python3.6/site-packages/rq/queue.py", line 142, in fetch_job
  self.remove(job_id)
File "/home/tom/dashenv/dash/lib/python3.6/site-packages/rq/queue.py", line 186, in remove
  return self.connection.lrem(self.key, 1, job_id)
File "/home/tom/dashenv/dash/lib/python3.6/site-packages/redis/client.py", line 1580, in lrem
  return self.execute_command('LREM', name, count, value)
File "/home/tom/dashenv/dash/lib/python3.6/site-packages/redis/client.py", line 754, in execute_command
  connection.send_command(*args)
File "/home/tom/dashenv/dash/lib/python3.6/site-packages/redis/connection.py", line 619, in send_command
  self.send_packed_command(self.pack_command(*args))
File "/home/tom/dashenv/dash/lib/python3.6/site-packages/redis/connection.py", line 659, in pack_command
  for arg in imap(self.encoder.encode, args):
File "/home/tom/dashenv/dash/lib/python3.6/site-packages/redis/connection.py", line 124, in encode
  "byte, string or number first." % typename)
redis.exceptions.DataError: Invalid input of type: 'NoneType'. Convert to a byte, string or number first.
Run Code Online (Sandbox Code Playgroud)

预先感谢您的任何建议/提示。

祝一切顺利,汤姆

giw*_*yni 5

检查此链接:redis 3.0 它说redis-py不再接受NoneType