Page MenuHomeMiraheze

Extension:ManageWiki
Closed, ResolvedPublic

Description

I have installed ManageWiki (brilliant extension btw) on a hosting site where I am working on a Wiki for a friend. I cannot get it working.

I have this in localsettings.php

wfLoadExtension( 'ManageWiki' );
$wgManageWiki = array( 'cdb' => true, 'core' => true, 'extensions' => false, 'namespaces' => false, 'permissions' => false, 'settings' => false, );

When I select it manage wiki I get the below error:

A database query error has occurred. This may indicate a bug in the software.
[XIe3920UQ@Q2n8NVHjzyVQAAAFM] 2019-03-12 13:45:27: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"

Versions:
MediaWiki 1.32.0
PHP 7.2.13 (cgi-fcgi)
MySQL 5.7.23-percona-sure1-log
ICU 57.1
Lua 5.1.5

Event Timeline

John added a subscriber: John.Mar 12 2019, 14:02

Do you have CreateWiki installed and configured correctly?

I have CreateWiki installed. I am pretty sure I won't have it installed correctly. I'm a beginner at this type of thing. Of all the configuration settings listed on the https://www.mediawiki.org/wiki/Extension:CreateWiki, which ones are mandatory. If I'm struggling with identifying the values I should add, I'm pretty sure the hosting company should know where to source the information.

John added a comment.Mar 12 2019, 14:23

I will admit the installation docs arent the best. After all we have never installed the extensions ourselves but have crafted around a very simple base years ago.

I’ll get on to doing a test install now and properly give you some instructions and hopefully this will help! :)

Thanks, that would be really great – if it helps you at any point I can give you access to this chaps wiki so you can compare setup. He’s only just had it added and I’ve been working with his host provider trying to get useful extensions added. The provider hadn’t come across your extension before, so didn't know what to watch out.

Void added a subscriber: Void.EditedMar 12 2019, 16:40

I've installed CreateWiki/ManageWiki before, and this is the config I needed:

$wgCreateWikiDatabase = "wiki";  // Or any central DB
$wgCreateWikiSubdomain = "local.wmftest.net";  // Not sure about this one
$wgCreateWikiDBDirectory = '/srv/dblist';  // Or any other suitable place for dblists
$wgManageWikiCDBDirectory = '/var/cache/managewiki';  // Or any other location for a cache

You'll also need this at the bottom of LocalSettings.php to extract the config from ManageWiki:

$wgLocalDatabases = array();
$wmgDatabaseList = file( "/srv/dblist/all.dblist" );
// ManageWiki settings
foreach ( $wmgDatabaseList as $wikiLine ) {
	$wikiDB = explode( '|', $wikiLine, 6 );
	list( $DBname, $siteName, $siteLang, $siteExtensions, $siteSettings ) = array_pad( $wikiDB, 6, '' );
	$wgLocalDatabases[] = $DBname;
	$wgConf->settings['wgSitename'][$DBname] = $siteName;
	$wgConf->settings['wgLanguageCode'][$DBname] = $siteLang;
	$siteExtensionsArray = explode( ",", $siteExtensions );
	foreach ( $wgManageWikiExtensions as $name => $ext ) {
		if ( in_array( $name, $siteExtensionsArray ) ) {
			$wgConf->settings[$ext['var']][$DBname] = true;
		}
	}
	$siteSettingsArray = json_decode( $siteSettings, true );
	if ( is_array( $siteSettingsArray ) || is_object( $siteSettingsArray ) ) {
		foreach ( $siteSettingsArray as $setVar => $setVal ) {
			$wgConf->settings[$setVar][$DBname] = $setVal;
		}
	}
}

foreach ( $wgConf->settings['wgServer'] as $name => $val ) {
	foreach ( $wgConf->settings['wgMobileUrlTemplate'] as $value => $mobileurl ) {
		if ( $mobileurl === $wmgHostname ) {
			$wgDBname = $value;
		}
	}
        if ( $val === '//' . $wmgHostname ) {
            $wgDBname = $name;
        }
}

$wgConf->extractAllGlobals( $wgDBname );

Many thanks @Void. I'll pass this on to the hosting company to do as they'll want to know how to do it for future installs. Can I leave this open for the time being just in case they come back with any issues/questions?

@Void, your code depends on /srv/dblist/all.dblist and whereas I can reverse engineer some of the data there, I don't know what the whole file must look like.

Note that the site in question today is a single install, not a farm.

Thank you,
David
CiviHosting

Void added a comment.Mar 12 2019, 19:32

/srv/dblist/all.dblist comes from $wgCreateWikiDBDirectory ($wgCreateWikiDBDirectory . '/all.dblist'), and the actual file is created by the CreateWiki/ManageWiki extensions.

It is Michael back - what should I be setting to get rid of this please?

Special:CreateWiki

Permission error
Jump to navigation
Jump to search

You do not have permission to create wikis, for the following reason:

You are not allowed to execute the action you have requested.

or if I set this:

$wgManageWiki = array( 'cdb' => true, 'core' => true, 'extensions' => true, 'namespaces' => true, 'permissions' => true, 'settings' => true, );

I get this:

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Cannot access the database)

For the record, this is the code I have in place currently. The last part is commented out because otherwise the site won't start. Seems we have a bit of a chicken/egg problem with all.dblist...

Code:

wfLoadExtension( 'CreateWiki' );
wfLoadExtension( 'ManageWiki' );
$wgManageWiki = array( 'cdb' => false, 'core' => false, 'extensions' => false, 'namespaces' => false, 'permissions' => false, 'settings' => false, );

$wgCreateWikiDatabase = "wiki";  // Or any central DB
$wgCreateWikiSubdomain = "excel1.net";  // Not sure about this one
$wgCreateWikiDBDirectory = '/home/excel/www/www/dblist';  // Or any other suitable place for dblists
$wgManageWikiCDBDirectory = '/home/excel/www/www/cache';  // Or any other location for a cache

$wgLocalDatabases = array();
$wmgDatabaseList = file( $wgCreateWikiDBDirectory . "/all.dblist" );
// ManageWiki settings
foreach ( $wmgDatabaseList as $wikiLine ) {
	$wikiDB = explode( '|', $wikiLine, 6 );
	list( $DBname, $siteName, $siteLang, $siteExtensions, $siteSettings ) = array_pad( $wikiDB, 6, '' );
	$wgLocalDatabases[] = $DBname;
	$wgConf->settings['wgSitename'][$DBname] = $siteName;
	$wgConf->settings['wgLanguageCode'][$DBname] = $siteLang;
	$siteExtensionsArray = explode( ",", $siteExtensions );
	foreach ( $wgManageWikiExtensions as $name => $ext ) {
		if ( in_array( $name, $siteExtensionsArray ) ) {
			$wgConf->settings[$ext['var']][$DBname] = true;
		}
	}
	$siteSettingsArray = json_decode( $siteSettings, true );
	if ( is_array( $siteSettingsArray ) || is_object( $siteSettingsArray ) ) {
		foreach ( $siteSettingsArray as $setVar => $setVal ) {
			$wgConf->settings[$setVar][$DBname] = $setVal;
		}
	}
}
/*
foreach ( $wgConf->settings['wgServer'] as $name => $val ) {
	foreach ( $wgConf->settings['wgMobileUrlTemplate'] as $value => $mobileurl ) {
		if ( $mobileurl === $wmgHostname ) {
			$wgDBname = $value;
		}
	}
        if ( $val === '//' . $wmgHostname ) {
            $wgDBname = $name;
        }
}

$wgConf->extractAllGlobals( $wgDBname );
*/
NDKilla added a subscriber: NDKilla.Mar 13 2019, 13:41

It is Michael back - what should I be setting to get rid of this please?
Special:CreateWiki
Permission error
Jump to navigation
Jump to search
You do not have permission to create wikis, for the following reason:
You are not allowed to execute the action you have requested.

It looks like you don't give any user groups the right to create wikis (createwiki)

Void added a comment.Mar 13 2019, 16:03

For the record, this is the code I have in place currently. The last part is commented out because otherwise the site won't start. Seems we have a bit of a chicken/egg problem with all.dblist...

Sounds like you have one of two problems here.

  1. /home/excel/www/www/dblist and/or /home/excel/www/www/cache is not writable by www-data (it preferably should be owned by www-data).
  2. $wgConf is not defined, in which case, you'd need to set $wgConf = new SiteConfiguration; above the line for $wgLocalDatabases.
  3. Additional configuration of $wgConf may be needed.

Following discussions with Civihosting we don't think this extension is suitable for the environment as their system will not allow the extension to create databases on their server. CiviHosting could word it better from a technical front, but from my point of view I can't ask them to expend anymore time trying to get this extension working.

So I've closed this ticket.

Michaeldakin closed this task as Resolved.Mar 13 2019, 17:01
Michaeldakin claimed this task.