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

fix predis clear() when using redis 7.4 #1522

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

vintagesucks
Copy link
Contributor

Hi! We noticed that horizon:clear-metrics stopped working after upgrading Redis from 7.2.6 to 7.4.1.

To reproduce, run:

laravel new example-app -n
cd example-app
composer require "laravel/horizon:5.30" "predis/predis:2.3.0"
REDIS_CLIENT=predis php artisan horizon:clear-metrics

When using Redis 7.2.6:

   INFO  Metrics cleared successfully. 

When using Redis 7.4.0 or 7.4.1:

   Predis\Response\ServerException 

  ERR invalid cursor

  at vendor/predis/predis/src/Client.php:416
    412▕             return $response;
    413▕         }
    414▕ 
    415▕         if ($this->options->exceptions) {
  ➜ 416▕             throw new ServerException($response->getMessage());
    417▕         }
    418▕ 
    419▕         return $response;
    420▕     }

      +19 vendor frames 

  20  artisan:13
      Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

A similar issue was recently fixed in symfony/cache, and applying that fix to Horizon seems to fix the problem when testing locally against the three Redis versions mentioned.

@taylorotwell taylorotwell merged commit 7717764 into laravel:5.x Dec 13, 2024
13 checks passed
@vintagesucks vintagesucks deleted the predis-err-invalid-cursor branch December 13, 2024 14:13
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

Successfully merging this pull request may close these issues.

2 participants