Page MenuHomePhabricator

500 error trying to setup monoversion template
Open, Needs TriagePublicBUG REPORT

Description

I want to convert a single wiki to use MediaWikiFarm; with the intention of adding a second domain into the configuration once it's working. I get a 500 error so I'm unable to continue further.

Steps to Reproduce:
Using the farms.yml template for monoversion as a guide, I have

mywiki:
   
   server: 'slicer\.qualitybox\.us'
   suffix: 'wiki'
   wikiID: 'mywiki'
   config:
     - file: 'LocalSettings.php'
       executable: true

The LocalSettings.php files have been swapped out (original file is now in /etc/mediawiki/LocalSettings.php)
($IP/extensions/MediaWikiFarm/docs/config/LocalSettings.php is now in $IP/LocalSettings.php)

The file /opt/htdocs/mediawiki/extensions/MediaWikiFarm/config/MediaWikiFarmDirectories.php is setup.

Actual Results:

I get HTTP 500 error

In syslog, I see the following:

Jul 19 11:10:01 slicer mediawikifarm: Undefined host
Jul 19 11:12:01 slicer mediawikifarm: Undefined host
Jul 19 11:14:20 slicer mediawikifarm: No configuration file found
Jul 19 11:15:02 slicer mediawikifarm: Undefined host

Expected Results:

A normal wiki, or at least an error message that describes what is wrong. @Seb35
can you help me understand what I'm doing wrong?

Event Timeline

Assuming this task is about MediaWiki-extensions-MediaWikiFarm hence adding project tag so others can find this task under that project.
Removing assignee as per https://www.mediawiki.org/wiki/How_to_report_a_bug , assuming that Seb35 has not explicitly agreed beforehand to work on this.

First of all, you need to set

$wgMediaWikiFarmCacheDir = '/tmp/mw-cache';

(or set it to false) in your new LocalSettings.php stub. Then you need a configuration that works (sudo grep mediawiki /var/log/syslog for clues)

This configuration in /etc/mediawiki/farms.php worked for me

<?php

return array(

    # Placeholder configuration for a first installation as detailled in the documentation
    'mywiki' => array(
        'server' => '(?P<client>[a-z]+)\.(?P<family>[a-z]+)\.(?P<tld>[a-z]+)',
        'variables' => array(
			array(  'variable' => 'client',
                    'file'    => 'conf/$tld/$family/client.php'
            ),
        ),
        'suffix' => '$family',
        'wikiID' => '$client-$family',
        'config' => array(
            array( 'file' => 'LocalSettings.php',
                   'executable' => true,
            ),
        ),
    ),
);

with the following directory structure in etc/mediawiki

├── conf
│   ├── org
│   │   └── ncigt
│   │       └── client.php
│   └── us
│       └── qualitybox
│           └── client.php
├── farms.php
├── LocalSettings.php

And the following contents in /etc/mediawiki/conf/us/qualitybox/client.php

<?php
return ['slicer', 'meta '];