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

MUC: Memcache server configuration too sensitive to whitespace

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.4
    • 2.4.8, 2.5.4, 2.6
    • Caching
    • MOODLE_24_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • MDL-42839-master
    • Hide

      NOTE: Test requires access to dataroot directory.

      1. Go to cache configuration page (System admin/Plugins/Caching/Configuration).
      2. Under 'Installed cache stores', click 'Add instance' in the memcache row
      3. For store name, type 'Test'. For servers, type: ' test.example.org ' (with spaces at start and end), then hit return to add a line feed after the single line. Also add a line like ' test.example.org:12345 ' (including extra space)
      4. Save changes.
      5. In the dataroot directory, find the file muc/config.php. Search for 'Test' and look for the servers array.

      EXPECTED: The servers array should have a single entry 0 => 0 => 'test.example.org'.

      BEFORE FIX: The array has two entries, one of which is test.example.org but surrounded by spaces and with a carriage return after it, and the other is an empty string.

      Repeat with Memcached

      Show
      NOTE: Test requires access to dataroot directory. 1. Go to cache configuration page (System admin/Plugins/Caching/Configuration). 2. Under 'Installed cache stores', click 'Add instance' in the memcache row 3. For store name, type 'Test'. For servers, type: ' test.example.org ' (with spaces at start and end), then hit return to add a line feed after the single line. Also add a line like ' test.example.org:12345 ' (including extra space) 4. Save changes. 5. In the dataroot directory, find the file muc/config.php. Search for 'Test' and look for the servers array. EXPECTED: The servers array should have a single entry 0 => 0 => 'test.example.org'. BEFORE FIX: The array has two entries, one of which is test.example.org but surrounded by spaces and with a carriage return after it, and the other is an empty string. Repeat with Memcached

    Description

      The memcache configuration forms are highly sensitive to whitespace. In particular, if you include a blank line at the end of the form, it will result in unexpected behaviour. This is easy to do when copy-pasting lists of servers; we've done this multiple times in live configuration.

      The server lists should have a basic level of tolerance for whitespace.

      Attachments

        Activity

          People

            quen Sam Marshall
            quen Sam Marshall
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Frédéric Massart Frédéric Massart
            Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              18/Nov/13