Moodle
  1. Moodle
  2. MDL-41246

Using memcache in MUC with non-standard port throws notices on every page

    Details

    • Testing Instructions:
      Hide

      Testing prerequisites

      1. Install a memcache client for PHP
      2. Install a memcached server
      3. Configure 2 instances on different ports (Ex. : localhost:11211 and localhost:11212)
      4. Assert that Memcache is detected in Moodle ("Site administration > Plugins > Caching > Configuration").

      Testing instructions

      1. Go to "Site administration > Plugins > Caching > Cache stores > Memcache"
      2. Write the following in "Test servers" text area :

        localhost:11211
        localhost:11212
        

      3. Go to "Site administration > Plugins > Caching > Test performance"
      4. There should no error in the top of the page saying "Notice: A non well formed numeric value encountered in /app/apache2/htdocs/moodlegit/cache/stores/memcache/lib.php on line 134"
      Show
      Testing prerequisites Install a memcache client for PHP Install a memcached server Configure 2 instances on different ports (Ex. : localhost:11211 and localhost:11212) Assert that Memcache is detected in Moodle ("Site administration > Plugins > Caching > Configuration"). Testing instructions Go to "Site administration > Plugins > Caching > Cache stores > Memcache" Write the following in "Test servers" text area : localhost:11211 localhost:11212 Go to "Site administration > Plugins > Caching > Test performance" There should no error in the top of the page saying "Notice: A non well formed numeric value encountered in /app/apache2/htdocs/moodlegit/cache/stores/memcache/lib.php on line 134"
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull 2.6 Branch:
      MDL-41246-moodle26
    • Pull Master Branch:
      MDL-41246-master

      Description

      Notice: A non well formed numeric value encountered in <path>/cache/stores/memcache/lib.php on line ~135

        Gliffy Diagrams

          Activity

          Hide
          Matteo Scaramuccia added a comment - - edited

          Hi Peter,
          could you post your configuration? Line by line, as per the example provided with the inline help:

          server.url.com
          ipaddress:port
          servername:port:weight
          

          Show
          Matteo Scaramuccia added a comment - - edited Hi Peter, could you post your configuration? Line by line, as per the example provided with the inline help: server.url.com ipaddress:port servername:port:weight
          Hide
          Peter Bulmer added a comment -

          The last two lines of this comment are the lines from the config. Prior to a recent change, we had the same config, without the ':11212' on each line. Without the ':11212' there was no notice being issued.

          memcache-a:11212
          memcache-b:11212

          Show
          Peter Bulmer added a comment - The last two lines of this comment are the lines from the config. Prior to a recent change, we had the same config, without the ':11212' on each line. Without the ':11212' there was no notice being issued. memcache-a:11212 memcache-b:11212
          Hide
          Ankit Agarwal added a comment -

          Thanks for reporting this.

          I've put that on the backlog.

          In the meantime feel free to help us work on this issue. If you are able to provide a patch or links to your Git repository branch, please add a patch label so we will spot it.

          Show
          Ankit Agarwal added a comment - Thanks for reporting this. I've put that on the backlog. In the meantime feel free to help us work on this issue. If you are able to provide a patch or links to your Git repository branch, please add a patch label so we will spot it.
          Hide
          Jean-Philippe Gaudreau added a comment - - edited

          Problem's still in 2.5.3 and 2.6. You must have more than one server configured in memcache to reproduce.

          Here's what could be done on line 134 of file "cache/stores/memcache/lib.php" to fix this issue :

          $this->connection->addServer($server[0], (int) $server[1], true, (int) $server[2]);
          

          I'll try to put the patch to peer review if I have some more time to work on that.

          Show
          Jean-Philippe Gaudreau added a comment - - edited Problem's still in 2.5.3 and 2.6. You must have more than one server configured in memcache to reproduce. Here's what could be done on line 134 of file "cache/stores/memcache/lib.php" to fix this issue : $this->connection->addServer($server[0], (int) $server[1], true, (int) $server[2]); I'll try to put the patch to peer review if I have some more time to work on that.
          Hide
          Jean-Philippe Gaudreau added a comment -

          I've tried to reproduce the problem with fresh master/26/25/24 installations and wasn't able to get the notice has it appends (every clicks or so) in our own environment... Maybe there's some different configurations and/or packages that cause the problem. Still I was able to find a way to output the notice in fresh master/26/25/24 when configuring and running the performance test in caching with memcache (Site administration > Plugins > Caching > Test performance).

          If anyone has testing instructions on how to reproduce it otherwise, please let me know. In the meantime, I still think it's important to push the above fix.

          Show
          Jean-Philippe Gaudreau added a comment - I've tried to reproduce the problem with fresh master/26/25/24 installations and wasn't able to get the notice has it appends (every clicks or so) in our own environment... Maybe there's some different configurations and/or packages that cause the problem. Still I was able to find a way to output the notice in fresh master/26/25/24 when configuring and running the performance test in caching with memcache (Site administration > Plugins > Caching > Test performance). If anyone has testing instructions on how to reproduce it otherwise, please let me know. In the meantime, I still think it's important to push the above fix.
          Hide
          Jean-Philippe Gaudreau added a comment -

          Note : If anyone has the memcached client configured, it would be nice to give some feedbacks if the problem is happening.

          Show
          Jean-Philippe Gaudreau added a comment - Note : If anyone has the memcached client configured, it would be nice to give some feedbacks if the problem is happening.
          Hide
          Dan Poltawski added a comment -

          Hi Jean-Philippe,

          So, looking at this issue - we are not able to reproduce the issue at the moment?

          Show
          Dan Poltawski added a comment - Hi Jean-Philippe, So, looking at this issue - we are not able to reproduce the issue at the moment?
          Hide
          Dan Poltawski added a comment -

          Sorry - I followed the testing instructions and now I can reproduce the issue.

          Sending for integration.

          Show
          Dan Poltawski added a comment - Sorry - I followed the testing instructions and now I can reproduce the issue. Sending for integration.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Hi guys,

          this is just a message to share with you that I'm going to perform a test of the automated pre-checker against all the current issues awaiting integration (16 issues).

          So, soon, you'll get some extra comments in this issue with some information from the pre-checker. Note it's not final, but just an experiment and there are lots of things to improve, from the message itself to various false positives in the checkers. So take any report with caution, it's not 100% accurate yet.

          Please, feel free to comment any idea/objection @ MDLSITE-2662. I'll be collecting everything there.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Hi guys, this is just a message to share with you that I'm going to perform a test of the automated pre-checker against all the current issues awaiting integration (16 issues). So, soon, you'll get some extra comments in this issue with some information from the pre-checker. Note it's not final, but just an experiment and there are lots of things to improve, from the message itself to various false positives in the checkers. So take any report with caution, it's not 100% accurate yet. Please, feel free to comment any idea/objection @ MDLSITE-2662 . I'll be collecting everything there. TIA and ciao
          Hide
          CiBoT added a comment -

          Results for MDL-41246

          Show
          CiBoT added a comment - Results for MDL-41246 Branch MDL-41246 -moodle24 to be integrated into upstream MOODLE_24_STABLE Executed job http://ci.stronk7.com/job/Precheck%20remote%20branch/705 Execution status: 2 Error: Unable to fetch information from MDL-41246 -moodle24 branch at git@github.com:StudiUM/moodle.git. Branch MDL-41246 -moodle25 to be integrated into upstream MOODLE_25_STABLE Executed job http://ci.stronk7.com/job/Precheck%20remote%20branch/706 Execution status: 2 Error: Unable to fetch information from MDL-41246 -moodle25 branch at git@github.com:StudiUM/moodle.git. Branch MDL-41246 -moodle26 to be integrated into upstream MOODLE_26_STABLE Executed job http://ci.stronk7.com/job/Precheck%20remote%20branch/707 Execution status: 2 Error: Unable to fetch information from MDL-41246 -moodle26 branch at git@github.com:StudiUM/moodle.git. Branch MDL-41246 -master to be integrated into upstream master Executed job http://ci.stronk7.com/job/Precheck%20remote%20branch/708 Execution status: 2 Error: Unable to fetch information from MDL-41246 -master branch at git@github.com:StudiUM/moodle.git.
          Hide
          Jean-Philippe Gaudreau added a comment -

          Hemmmm, it seems the code checker failed... Please tell me if it's because there's a problem with my pull branches.

          Show
          Jean-Philippe Gaudreau added a comment - Hemmmm, it seems the code checker failed... Please tell me if it's because there's a problem with my pull branches.
          Hide
          Sam Hemelryk added a comment -

          Hiya Jean-Philippe, the fail occured because the "Pull from repository" you used on the issue was your SSH URL that requires authentication (git@github.com:StudiUM/moodle.git) instead of a publicly accessible URL like git://github.com/StudiUM/moodle.git or https://github.com/StudiUM/moodle.

          I've fixed that up now, code changes are fine I am confident it would not have failed.

          Show
          Sam Hemelryk added a comment - Hiya Jean-Philippe, the fail occured because the "Pull from repository" you used on the issue was your SSH URL that requires authentication (git@github.com:StudiUM/moodle.git) instead of a publicly accessible URL like git://github.com/StudiUM/moodle.git or https://github.com/StudiUM/moodle . I've fixed that up now, code changes are fine I am confident it would not have failed.
          Hide
          Sam Hemelryk added a comment -

          Thanks Jean-Philippe, I've integrated this now.

          Show
          Sam Hemelryk added a comment - Thanks Jean-Philippe, I've integrated this now.
          Hide
          Sam Hemelryk added a comment -

          Tested and passed during integration review.

          Show
          Sam Hemelryk added a comment - Tested and passed during integration review.
          Hide
          Sam Hemelryk added a comment -

          Thank you, your code has landed just in time for 2013.
          Merry Christmas and may your 2014 be even better than 2013.

          Kind regards with much holiday spirit
          Sam

          Show
          Sam Hemelryk added a comment - Thank you, your code has landed just in time for 2013. Merry Christmas and may your 2014 be even better than 2013. Kind regards with much holiday spirit Sam

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: