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

Redis server issues break cache configuration page

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Requirements:

      • redis server running (via docker , service in the computer or remote)
      • ability to stop the redis server.

      Steps:

      1. Run redis locally via docker (or normal service in the computer if you've it already):
        • docker run --net-host redis
      2. Create a redis cache instance in Moodle:
        • Site admin -> plugins -> caching -> configuration
        • Under 'Installed cache stores", next to Redis, click "Add instance"
        • Enter 127.0.0.1:6379 in the server field and save
        • Confirm that it shows as "ready" under "Configured store instances" (the second table on the page)
      3. Kill the redis server (just Ctrl + C the running container, or stop the service if running locally)
      4. Go back to the cache page and reload.
      5. Confirm that you don't see an error message (either "Connection refused" or "getaddrinfo failed" depending on what you did in step 2)
      6. Confirm that your redis instance is not marked as ready (Check under the "Configured store instances" section)
      Show
      Requirements: redis server running (via docker , service in the computer or remote) ability to stop the redis server. Steps: Run redis locally via docker (or normal service in the computer if you've it already): docker run --net-host redis Create a redis cache instance in Moodle: Site admin -> plugins -> caching -> configuration Under 'Installed cache stores", next to Redis, click "Add instance" Enter 127.0.0.1:6379 in the server field and save Confirm that it shows as "ready" under "Configured store instances" (the second table on the page) Kill the redis server (just Ctrl + C the running container, or stop the service if running locally) Go back to the cache page and reload. Confirm that you don't see an error message (either "Connection refused" or "getaddrinfo failed" depending on what you did in step 2) Confirm that your redis instance is not marked as ready (Check under the "Configured store instances" section)
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE
    • Pull from Repository:
    • Pull 3.9 Branch:
    • Pull 3.10 Branch:
      MDL-65941-310
    • Pull Master Branch:
      MDL-65941-master

      Description

      If you have an instance of the redis cache store, and Moodle is unable to connect to the redis server, the cache configuration page fails with an exception. This is unlike the behaviour of other stores, like memcached, where the instance is simply marked as "not ready" if the server can't be contacted.

      This is potentially a pretty serious issue for server administrators as it makes it impossible to switch to another cache store while a redis server is unavailable.

      To reproduce (with a working redis server):

      1. Create a redis cache instance. Confirm that it shows as "ready".
      2. Kill the redis server (either kill the process, or the container)
      3. Go back to the cache page.
      4. You will see an error message (either "Connection refused" or "getaddrinfo failed" depending on what you did in step 2) and be unable to edit your cache configuration.

      I'm seeing this with versions 4.1.1 and 4.3.0 of the redis plugin.

        Attachments

        1. MDL-65941-step1.png
          MDL-65941-step1.png
          34 kB
        2. MDL-65941-step2.png
          MDL-65941-step2.png
          28 kB
        3. MDL-65941-step3.png
          MDL-65941-step3.png
          38 kB
        4. MDL-65941-steps-4-5-6.png
          MDL-65941-steps-4-5-6.png
          28 kB

          Activity

            People

            Assignee:
            maherne Michael Aherne
            Reporter:
            maherne Michael Aherne
            Peer reviewer:
            Jake Dallimore
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Ilya Tregubov
            Participants:
            Component watchers:
            Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            5 Vote for this issue
            Watchers:
            13 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              18/Jan/21

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 47 minutes
                1h 47m