Last modified: 2014-09-23 19:31:01 UTC
Created attachment 10914 [details] Authplugin that references conference management system DB We have an authplugin that has been used for several years to tie a conference management system and mediawiki together for similar sign-on . This year, we've deviated from the norm and used MediaWiki-1.19.1 (previous years have used the Debian packaged version), and we seem to be hitting a problem with the IP Block check query. Both the conference management system and mediawiki are running on (separate) pgsql databases. We have one user in the database, being the local user created at install time, but when they attempt to log in (with the plugin enabled), we hit the following SQL error; Query confwiki (18) (slave): SELECT /* User::idFromName 202.158.221.43 */ user_id FROM "mwuser" WHERE user_name = 'Lca2013' LIMIT 1 User::getBlockedStatus: checking... Query confwiki (19) (slave): SELECT /* Block::newLoad 202.158.221.43 */ * FROM "ipblocks" WHERE ipb_address IN ('20215822143','20215822143') OR ((ipb_range_start LIKE '%' ) AND (ipb_range_start <= 0) AND (ipb_range_end >= 0)) SQL ERROR: ERROR: operator does not exist: text <= integer LINE 1: ...(ipb_range_start LIKE '%' ) AND (ipb_range_start <= 0) AND ... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. All further queries in this transaction return the error "SQL ERROR (ignored): ERROR: current transaction is aborted, commands ignored until end of transaction block" This query run in pgsql fails with the same error. Disabling the external auth plugin solves the problem, but to the point where we can't even see the above query being run in debug, so we're not sure quite what's happening here, or if the external authplugin just happens to trigger an edgecase not yet found. Reading the authplugin docs doesn't show anything needed in an authplugin to make the ipblock side of things work. Changes to the LocalSettings.php are; $wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['*']['edit'] = false; $wgFileExtensions = array_merge( $wgFileExtensions, array( 'pdf', 'ppt' , 'odt', 'odf', 'odp', 'otp') ); require_once( "$IP/extensions/googleAnalytics/googleAnalytics.php" ); include( "$IP/extensions/AuthPluginLCA.php" ); $wgAuth = new AuthPluginLCA; $wgGroupPermissions['*']['edit'] = false; // MediaWiki 1.5+ Settings $wgGroupPermissions['*']['createaccount'] = false; // MediaWiki 1.5+ Settings ###enabled for debug only $wgShowSQLErrors = true; $wgDebugDumpSql = true; $wgDebugLogFile = "/srv/http/wiki-debug.log";
Sounds like something is wrong with you external plugin and not in mediawiki. One more point is, did you remove the old wiki and installed a fresh one or did you upgrade?
Hi Matanya thanks for the reply. Due to privacy issues, every year gets a new VM, so this was a clean install from the 1.19.1 tar.gz. The query I highlighted will always fail (I believe), as it's trying to compare text to an integer to see if it matches any existing blocks in the database, which is just going to go to custard. Should the ipb_range_start column be an int and not text?
OK, thinking about that for a a few days, I can see that changing those columns to int won't work for ipv6, so they need to remain text. This still looks like a problem with the query itself, not our plugin, it's just our plugin triggering the issue.
This also occurs with a clean 1.18.5 install and just my auth plugin Query: SELECT * FROM "ipblocks" WHERE ipb_address IN ('123123123123','123123123123') OR ((ipb_range_start LIKE '%' ) AND (ipb_range_start <= 0) AND (ipb_range_end >= 0)) Function: Block::newLoad Error: 1 ERROR: operator does not exist: text <= integer I'd be really interested in knowing if this is an actual bug with MW, or something else.
Krenair, could you take a moment to look at this?
That query works for me in MySQL if I get rid of the apostrophes around the table name. This sounds like something has been tested to work with MySQL but not PostgreSQL. I don't know anything about that database system though, so I can't help.