mosquito-cr / mosquito

A background task runner for crystal applications supporting periodic (CRON) and manually queued jobs
MIT License
227 stars 24 forks source link

unknown command `lmove` #132

Closed jwoertink closed 1 month ago

jwoertink commented 8 months ago

Just upgraded to the latest Mosquito and after deploying, my workers all break with this error

Unhandled exception in spawn: ERR unknown command `lmove`, with args beginning with: `mosquito:waiting:event_save_worker`, `mosquito:pending:event_save_worker`, `RIGHT`, `LEFT`,  (Redis::Error)
  from /home/runner/work/joysticktv/joysticktv/lib/redis/src/parser.cr:54:9 in 'read'
  from /home/runner/work/joysticktv/joysticktv/lib/redis/src/connection.cr:406:7 in 'run'
  from /home/runner/work/_temp/crystal-1.10.1-true-undefined/share/crystal/src/fiber.cr:146:11 in 'run'
  from ???

Please include some details:

Crystal version: 1.10.1 Mosquito Shard version: 1.0.2 Redis: 0.7.1

robacarp commented 8 months ago

This is because of an out of date redis version. You should be able to update redis and resolve.

jwoertink commented 8 months ago

Doesn't Mosquito lock to 0.7.x though?

https://github.com/mosquito-cr/mosquito/blob/703a90a71d22c5e0495633e0af1c0b5bbd606c26/shard.yml#L21

Or would I just add an override?

robacarp commented 8 months ago

Hmm...Something's amiss. I'm running the same stack as you are, but I don't get the error. From my shard.lock:

  mosquito:
    git: https://github.com/mosquito-cr/mosquito.git
    version: 1.0.2+git.commit.703a90a71d22c5e0495633e0af1c0b5bbd606c26

  redis:
    git: https://github.com/jgaskins/redis.git
    version: 0.7.1

The LMOVE command had an associated bug in the redis adapter, and the commit mentioned 0adfc34e53f061545c570c9362a010b903ecf429 was present going back to 0.7.0.

Can you post your shard.lock lines for mosquito and redis?

jwoertink commented 8 months ago
  mosquito:
    git: https://github.com/mosquito-cr/mosquito.git
    version: 1.0.2

  redis:
    git: https://github.com/jgaskins/redis.git
    version: 0.7.1

This is what the shard.lock had.

jwoertink commented 8 months ago

Looks like this is caused because we're using Redis 6.0.5 in production, and LMOVE didn't show up until 6.2. We will have to just upgrade.

robacarp commented 8 months ago

Since LMOVE was added merely to quit using a deprecated redis command, I think it makes sense to add a config option for this which can revert to the old behavior.