• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Docker Redis throws 'read error on connection'

xmh87

New Pleskian
I've been using Redis on a docker image for a short while (a week or so), installed through plesk with success. We've decided to upgrade the hardware of the VPS server and after the upgrade & reboot the docker Redis throws "read error on connection" when trying to do anything other than connecting.


I've tried setting PHP's default_socket_timeout

PHP:
ini_set('default_socket_timeout', -1);

and the redis timeout:

PHP:
$clientRedis->setOption(Redis::OPT_READ_TIMEOUT, -1);

But still the error remains..
Here's my code I use for testing:

PHP:
    <?php
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    ini_set('default_socket_timeout', -1);
    
    $clientRedis = new Redis();
    
    function Redis_connect($hostname, $port){
        $start = time();
        global $clientRedis;
        try {
            
            $connected = $clientRedis->connect($hostname, $port);
            
            $clientRedis->setOption(Redis::OPT_READ_TIMEOUT, -1);
            if (!$connected) { throw new Exception(); }
        } catch (Exception $e) {
            $elapsed = time() - $start;
            echo "Elapsed: " . $elapsed . "\n";
            die($e->getMessage());
        }
    
    
    }
    
    //Connecting to Redis server on localhost
    echo Redis_connect("127.0.0.1", 6379);
    
    
    echo "Connected to server successfully";
    echo "";
    echo "Server is running: " . $clientRedis->ping();
    echo "";
    
    
    ?>

This outputs:

Code:
    Connected to server successfully
    Fatal error: Uncaught RedisException: read error on connection in [..]/redis.php:32 Stack trace: #0 [..]/redis.php(32): Redis->ping() #1 {main} thrown in [..]/redis.php on line 32

the only thing I could find on Google was the timeout settings mentioned above, which did not work. I've tried several image versions, alpine, latest, 5.0.8; all the same error.
Strangest thing is that it worked before the reboot/upgrade. The VPS company won't provide any support because it is software..


Does anyone know what's going on here?
 
Back
Top