Skip to content

WRONGPASS invalid username-password pair or user is disabled after upgrading to predis 3 #1534

@denydias

Description

@denydias

Describe the bug
Just after upgrading to predis v3.0.0 connection fails with:

  Predis\Connection\ConnectionException 

Failed: WRONGPASS invalid username-password pair or user is disabled. [tcp://127.0.0.1:6379]

at vendor/predis/predis/src/Connection/AbstractConnection.php:157
  153▕      */
  154▕     protected function onConnectionError($message, $code = 0): void
  155▕     {
  156▕         CommunicationException::handle(157▕             new ConnectionException($this, "$message [{$this->getParameters()}]", $code)
  158▕         );
  159▕     }
  160▕ 
  161▕     /**

    +28 vendor frames 

29  artisan:35
    Illuminate\Foundation\Console\Kernel::handle()

To Reproduce
Steps to reproduce the behavior:

  1. Change composer.json requirements from "predis/predis": "^2.4" to "predis/predis": "^3.0";
  2. Run composer update;
  3. Run artisan cache:clear;
  4. See error above.

Expected behavior
artisan cache:clear finishing with message INFO Application cache cleared successfully. and no error.

Versions

  • Laravel: 11.44.7
  • Predis: 3.0.0
  • PHP: 8.3.20
  • Redis Server: 7.4+ (incl. 8)
  • OS: Ubuntu 24.04.2 LTS

Code sample
N/A

Additional context
Laravel example for completion purposes. It happens just the same on a test app with predis being the single requirement. predis v2.4.0 works fine though.

  • .env contains:

    CACHE_DRIVER=redis
    SESSION_DRIVER=redis
    REDIS_PASSWORD=secret
  • config/database.php contais:

    'redis' => [
        'client' => env('REDIS_CLIENT', 'predis'),
    
        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'prefix' => env(
                'REDIS_PREFIX',
                Str::slug(env('APP_NAME','laravel'), '_').'_database_'
            ),
            'scheme' => env('REDIS_SCHEME', 'unix'),
        ],
    
        'default' => [
            'url' => env('REDIS_URL'),
            'path' => env('REDIS_PATH', '/var/run/redis/redis-server.sock'),
            'password' => env('REDIS_PASSWORD'),
            'database' => env('REDIS_DB', 0),
        ],
    
        'cache' => [
            'url' => env('REDIS_URL'),
            'path' => env('REDIS_PATH', '/var/run/redis/redis-server.sock'),
            'password' => env('REDIS_PASSWORD'),
            'database' => env('REDIS_CACHE_DB', 1),
        ],
    ],

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions