Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-81366

redis cache: Exception - Unknown named parameter $read_timeout

XMLWordPrintable

    • MOODLE_404_STABLE
    • MOODLE_404_STABLE
    • MDL-81366-main
    • Hide

      1. Setup Requirements

      1. To test the Redis cluster with other features that have been provided by the existing system, such as TLS/SSL, Auth Password, please follow the instructions on Usage section at https://github.com/meirzamoodle/middleware-tutorials-redis-cluster-tls/tree/main#usage
      2. To the single Redis unit testing, we need to install a single Redis on local machine and ensure it's running at 127.0.0.1:6379. Refer to this page on how to install Redis https://redis.io/docs/install/install-redis/.
      3. Ensure your machine has the PHP-Redis extension by checking on the Info PHP page. There are a lot of ways to check the PHP Info Page. Moodle has provided it on the Site Admin > Server > PHP info.
        If it has not been installed, you can install it by running the below command:

        pecl install redis

        Please visit https://developer.redis.com/develop/php/ for detailed information on how to do the installation.

      4. During the unit testing, if enabled, please disable the Xdebug on your PHP CLI config.

      2. Steps to run the PHPUnit for single Redis session

      1. Open config.php and add the below codes:

        define(
          'TEST_SESSION_REDIS_HOST',
          '127.0.0.1'
        );

      2. Make sure all the tests in lib/tests/session_redis_test.php are passed.

      3. Steps to run the PHPUnit for Redis cluster session

      1. Open config.php and add the below codes:

        define(
          'TEST_SESSION_REDIS_HOSTCLUSTER',
          '172.23.0.11,172.23.0.12,172.23.0.13,172.23.0.14,172.23.0.15,172.23.0.16'
        );
        define(
          'TEST_SESSION_REDIS_ENCRYPTCLUSTER',
          ['verify_peer' => false, 'verify_peer_name' => false],
        );
        define(
          'TEST_SESSION_REDIS_AUTHCLUSTER',
          'foobared'
        );

      2. Make sure all the tests in lib/tests/session_redis_cluster_test.php are passed.

      4. Steps to run the PHPUnit for single Redis cache store

      1. Open config.php and add the below codes:

        define(
          'TEST_CACHESTORE_REDIS_TESTSERVERS',
          '127.0.0.1'
        );

      2. Make sure all the tests in cache/stores/redis/tests/cachestore_redis_test.php are passed.

      5. Steps to run the PHPUnit for Redis cluster cache store

      1. Open config.php and add the below codes:

        define(
          'TEST_CACHESTORE_REDIS_SERVERSCLUSTER',
          '172.23.0.11,172.23.0.12,172.23.0.13,172.23.0.14,172.23.0.15,172.23.0.16'
        );
        define(
          'TEST_CACHESTORE_REDIS_ENCRYPTCLUSTER',
          true
        );
        define(
          'TEST_CACHESTORE_REDIS_AUTHCLUSTER',
          'foobared'
        );

      2. Make sure all the tests in cache/stores/redis/tests/cachestore_cluster_redis_test.php are passed.
      Show
      1. Setup Requirements To test the Redis cluster with other features that have been provided by the existing system, such as TLS/SSL, Auth Password, please follow the instructions on Usage section at https://github.com/meirzamoodle/middleware-tutorials-redis-cluster-tls/tree/main#usage To the single Redis unit testing, we need to install a single Redis on local machine and ensure it's running at 127.0.0.1:6379. Refer to this page on how to install Redis https://redis.io/docs/install/install-redis/ . Ensure your machine has the PHP-Redis extension by checking on the Info PHP page. There are a lot of ways to check the PHP Info Page. Moodle has provided it on the Site Admin > Server > PHP info. If it has not been installed, you can install it by running the below command: pecl install redis Please visit https://developer.redis.com/develop/php/ for detailed information on how to do the installation. During the unit testing, if enabled, please disable the Xdebug on your PHP CLI config. 2. Steps to run the PHPUnit for single Redis session Open config.php and add the below codes: define(   'TEST_SESSION_REDIS_HOST' ,   '127.0.0.1' ); Make sure all the tests in lib/tests/session_redis_test.php are passed. 3. Steps to run the PHPUnit for Redis cluster session Open config.php and add the below codes: define(   'TEST_SESSION_REDIS_HOSTCLUSTER' ,   '172.23.0.11,172.23.0.12,172.23.0.13,172.23.0.14,172.23.0.15,172.23.0.16' ); define(   'TEST_SESSION_REDIS_ENCRYPTCLUSTER' ,   [ 'verify_peer' => false , 'verify_peer_name' => false ], ); define(   'TEST_SESSION_REDIS_AUTHCLUSTER' ,   'foobared' ); Make sure all the tests in lib/tests/session_redis_cluster_test.php are passed. 4. Steps to run the PHPUnit for single Redis cache store Open config.php and add the below codes: define(   'TEST_CACHESTORE_REDIS_TESTSERVERS' ,   '127.0.0.1' ); Make sure all the tests in cache/stores/redis/tests/cachestore_redis_test.php are passed. 5. Steps to run the PHPUnit for Redis cluster cache store Open config.php and add the below codes: define(   'TEST_CACHESTORE_REDIS_SERVERSCLUSTER' ,   '172.23.0.11,172.23.0.12,172.23.0.13,172.23.0.14,172.23.0.15,172.23.0.16' ); define(   'TEST_CACHESTORE_REDIS_ENCRYPTCLUSTER' ,   true ); define(   'TEST_CACHESTORE_REDIS_AUTHCLUSTER' ,   'foobared' ); Make sure all the tests in cache/stores/redis/tests/cachestore_cluster_redis_test.php are passed.
    • 2
    • Team Hedgehog 2024 Sprint 1.3

      On the last 4.4 dev  (Moodle 4.4dev+ (Build: 20240326)) it's impossible  connect to a redis cache:
       

      Exception - Unknown named parameter $read_timeout

      More information about this error
      Debug info:
      Error code: generalexceptionmessage
      Stack trace: * line 282 of /cache/stores/redis/lib.php: Error thrown

      • line 201 of /cache/stores/redis/lib.php: call to cachestore_redis->new_redis()
      • line 903 of /cache/stores/redis/lib.php: call to cachestore_redis->__construct()
      • line 75 of /cache/testperformance.php: call to cachestore_redis::initialise_test_instance()
         

      Enviroment:

      • PHP Version 8.1.2
      • PHP Redis 5.3.5
      • Redis server v=6.0.16

            meirza.arson@moodle.com Meirza
            polder84 Enrico
            Matt Porritt Matt Porritt
            Huong Nguyen Huong Nguyen
            Laurent David Laurent David
            Votes:
            5 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours
                6h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.