18.10 memcached and couchbase empty getStats() return

Bug #1814316 reported by Octavio Jr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned
18.10
Fix Released
Medium
Unassigned
19.04
Fix Released
Medium
Unassigned

Bug Description

On file auth/session.php line 112 we have this bit of code :
$server_stats = $memcached->getStats();
                        if ($server_stats[$destination . ":" . $port]['pid'] <= 0) {
                            // can't reach the destination:port
                            throw new ConfigSanityException(get_string('nomemcachedserver', 'error', $server));
                        }

We use a setup of a couchbase server that can handle memcached, but when arrive at that line, 112, the method returns a empty, even though we can set and get any information from couchbase.

Is-it possible offers couchbase as a new type of sessionhandler?

Thank you

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Octavio,

Looking at this report https://stackoverflow.com/questions/9625768/memcachedgetstats-not-working-with-couchbase#9627895 it sounds like a one should be able to get info in getStats() if things are set up in a certain way.

It sounds like you are getting empty getStats() because of a proxy port issue
https://forums.couchbase.com/t/memcached-getstats-not-working-with-couchbase/4882

One thing you could try is dropping the following line in

       error_log(print_r($memcached->getVersion(), true));

After the line

       $memcached->addServer($destination, $port);

And take a look at your error log - does that line return any information?

Cheers

Robert

Revision history for this message
Octavio Jr (octavioudes) wrote :

Thank you for your answer,

I receive and array with server nanme :
array(1) {
  ["myserver.dom:11214"]=>
  string(5) "4.5.1"
}

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/9546

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Octavio,

Can you try the patch at https://reviews.mahara.org/#/c/9546/ to see if it makes any difference?

Cheers

Robert

Changed in mahara:
importance: Undecided → Medium
status: New → In Progress
milestone: none → 19.04.0
Revision history for this message
Octavio Jr (octavioudes) wrote :

Thank you for your patch, tested and approved !

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9546
Committed: https://git.mahara.org/mahara/mahara/commit/650fae5548eb3c70d6346684a242fb2dd00b2159
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: master

commit 650fae5548eb3c70d6346684a242fb2dd00b2159
Author: Robert Lyon <email address hidden>
Date: Tue Feb 12 09:55:42 2019 +1300

Bug 1814316: Checking memcached version if stats not available

behatnotneeded

Change-Id: I2bc1172044a160d72905bf56a55f505ccd1250c0
Signed-off-by: Robert Lyon <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "18.10_STABLE" branch: https://reviews.mahara.org/9610

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/9610
Committed: https://git.mahara.org/mahara/mahara/commit/5119438d6802e57cece185407e8258de68729048
Submitter: Cecilia Vela Gurovic (<email address hidden>)
Branch: 18.10_STABLE

commit 5119438d6802e57cece185407e8258de68729048
Author: Robert Lyon <email address hidden>
Date: Tue Feb 12 09:55:42 2019 +1300

Bug 1814316: Checking memcached version if stats not available

behatnotneeded

Change-Id: I2bc1172044a160d72905bf56a55f505ccd1250c0
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 650fae5548eb3c70d6346684a242fb2dd00b2159)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.