https://bugzilla.wikimedia.org/show_bug.cgi?id=38907

       Web browser: ---
             Bug #: 38907
           Summary: IP Block query fails with External auth
           Product: MediaWiki
           Version: 1.19
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: User blocking
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


Created attachment 10914
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=10914
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";

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to