Topic on Project:Support desk

Issues on wiki farm with logging into wikis using a shared database

6
91.65.183.96 (talkcontribs)

After upgrading from 1.31 to 1.34 it is no longer possible to automatically log into sister wikis using user tables.

Error message when trying to log in: Auto-creation of a local account failed: Username entered already in use. Please choose a different name.

$wgSharedDB = 'mywiki';
$wgSharedPrefix = 'prefix_';
$wgSharedTables = [
	'user',
	'user_groups',
	'interwiki',
	'ipblocks'
];
$wgCookieDomain = '.example.org';
$wgMainCacheType = CACHE_NONE;
$wgSessionCacheType = CACHE_DB;

$wgGroupPermissions['*']['autocreateaccount'] = true; // I added this and truncated the object cache table afterwards. In 1.31 it worked without it.


I have no clue how to go about it. Setting $wgSessionCacheType or not does not make a difference. Hoping for advice.

91.65.183.96 (talkcontribs)

I cannot edit my previous post. The software appears to be broken. I wanted to write "After upgrading from 1.31 to 1.34 it is no longer possible to automatically log into sister wikis using a shared user table." instead of "After upgrading from 1.31 to 1.34 it is no longer possible to automatically log into sister wikis using user tables."

Spas.Z.Spasov (talkcontribs)

Hello, in order to edit your previous post you need to create and use an account.

Here is the relevant part of our wiki family CommonSettings.php, that works as it is expected with MW 1.33 and now with 1.34 - note you need to check the option 'Keep me logged in' on the page 'Special:UserLogin':

<?php
$wgMainCacheType = CACHE_ACCEL;
$wgMainStash = CACHE_ACCEL;
$wgSessionCacheType = CACHE_ACCEL;
$wgParserCacheType = CACHE_ACCEL;  // optional
$wgMessageCacheType = CACHE_ACCEL; // optional
$wgUseGzip = true;
$wgUseGzip = true;

wfLoadExtension( 'Interwiki' );
$wgEnableScaryTranscluding = true;
//$wgInterwikiViewOnly = true;
$wgGroupPermissions['sysop']['interwiki'] = true;
$wgInterwikiCentralDB = 'example_commons';
$wgInterwikiMagic = true;
$wgHideInterlanguageLinks = false;

$wgSharedDB = 'example_commons'; // wiki database holding the main user table
//$wgSharedPrefix = 'm_';        // Currently we do not use prefix!
$wgSharedTables[] = 'user';      // I think we do not need that table
$wgSharedTables[] = 'ipblocks';
$wgSharedTables[] = 'user_groups';
$wgSharedTables[] = 'interwiki';
$wgSharedTables[] = 'user_properties';

// Login in all wikis at once; our wikis:
//   bg.example.org, ru.example.org, en.example.org, commons.example.org
// Note you need to check the option 'Keep me logged in'
//   on the page 'Special:UserLogin'.
// After some change is made here, restart the web server
//   and completely flush the browser's cache
$wgCookieDomain = '.example.org';
//$wgCookieSecure = false;


91.65.183.96 (talkcontribs)

Thanks a lot for your reply. I am afraid that it did not help me. I still have the same issue. Moreover I have to do

$wgSessionCacheType = CACHE_DB;

because otherwise I cannot even log in to the main wiki. The other two differences between your setup and mine was setting

$wgMainStash = CACHE_ACCEL;

which I have done now and adding the 'user_properties' table to the array of shared tables. I conclude that MediaWiki is not up for the job in a stable manner which is a bit disappointing. Still wonder why it worked in MediaWiki 1.31

91.65.183.96 (talkcontribs)

Hmm, now that the users are on the wiki the login to all wikis work, at least for existing users. The question is wether this is only an issue for me and me and the clients I use to access the site or because I use a newly created account.

41.114.198.251 (talkcontribs)

Ooo i like the idea of wiki but things must change

Reply to "Issues on wiki farm with logging into wikis using a shared database"