Last modified: 2012-04-16 09:16:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T27855, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 25855 - Installer fails to validate memcached server format, throws notices on use later
Installer fails to validate memcached server format, throws notices on use later
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
unspecified
All All
: High minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-09 21:16 UTC by Brion Vibber
Modified: 2012-04-16 09:16 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2010-11-09 21:16:06 UTC
I did a fresh local setup with current trunk; all defaults plus use of memcached, where I listed "localhost" in the servers field. This produces these lines in config:

  ## Shared memory settings
  $wgMainCacheType    = CACHE_MEMCACHED;
  $wgMemCachedServers = array( 'localhost' );


The memcached client library seems to assume that hosts will be consistently provided in "<host>:<port>" format, leading to a notice being thrown here if we got an entry that only had the host:

Notice: Undefined offset: 1 in /var/www/wiki/includes/memcached-client.php on line 692

Call Stack:
    0.0016     684584   1. {main}() /var/www/wiki/index.php:0
    0.0037     732512   2. require_once('/var/www/wiki/includes/WebStart.php') /var/www/wiki/index.php:41
    0.0220    1779440   3. require_once('/var/www/wiki/includes/Setup.php') /var/www/wiki/includes/WebStart.php:142
    0.0562    4320528   4. wfIncrStats() /var/www/wiki/includes/Setup.php:316
    0.0563    4320912   5. MWMemcached->incr() /var/www/wiki/includes/GlobalFunctions.php:2295
    0.0563    4321128   6. MWMemcached->_incrdecr() /var/www/wiki/includes/memcached-client.php:518
    0.0563    4321128   7. MWMemcached->get_sock() /var/www/wiki/includes/memcached-client.php:828
    0.0563    4321128   8. MWMemcached->sock_to_host() /var/www/wiki/includes/memcached-client.php:759
    0.0563    4321432   9. MWMemcached->_connect_sock() /var/www/wiki/includes/memcached-client.php:1016

That's this code here:

	function _connect_sock( &$sock, $host ) {
		list( $ip, $port ) = explode( ':', $host );

Either we should fix that code to be more pleasant and handle auto fallback to the default memcached port 11211, or the installer should validate the format of provided server entries.
Comment 1 Chad H. 2010-11-09 21:18:56 UTC
(In reply to comment #0)
> Either we should fix that code to be more pleasant and handle auto fallback to
> the default memcached port 11211, or the installer should validate the format
> of provided server entries.

Both :)
Comment 2 Mark A. Hershberger 2011-02-08 23:05:24 UTC
Seems like an easy fix.  I know you're busy right now, Chad, but has this already been fixed?
Comment 3 Chad H. 2011-02-09 03:16:26 UTC
No.
Comment 4 Chad H. 2011-02-23 17:55:24 UTC
Made the installer validate format in r82687.
Comment 5 Brion Vibber 2011-09-21 23:56:46 UTC
The validation code assumes that only IP addresses can be used, so rejects hostnames like 'localhost': bug 30041.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links