Jump to content

Project:Support desk

About this board

Welcome to the MediaWiki Support desk. This is a place where you can ask any questions you have about installing, using or administrating the MediaWiki software.

(Read this message in a different language)

See also

Before you post

Post a new question

  1. To help us answer your questions, please indicate which version of MediaWiki you are using, as found on your wiki's Special:Version page:
  2. If possible, add $wgShowExceptionDetails = true;error_reporting( -1 );ini_set( 'display_errors', 1 ); to LocalSettings.php in order to make MediaWiki show more detailed error messages.
  3. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  4. To start a new thread, click the box with the text "Start a new topic".

Pictures not displaying when logged out of Miraheze

3
DJC's Astracolonial Ventures (talkcontribs)

I've uploaded pictures to the main page of my wiki, but they only display when I'm logged in.  I'd like people I share the wiki link with to be able to see those pictures without having to have a Miraheze account, so what can I do to fix this?  Many thanks

Samwilson (talkcontribs)

Can you link to an example?

You'll probably have to ask this on the Miraheze community portal though; this support desk is about the MediaWiki software only.

185.10.159.100 (talkcontribs)

kkkr homo kakslaaf

Reply to "Pictures not displaying when logged out of Miraheze"

Links with templated includes blocked in MW1.42?

1
Ahaemmerli (talkcontribs)

I have different wikis running. On one running MediaWiki 1.42, links with templated are not interpreted as links, e.g. [[ {{valuefromtemplate}} ]] are just like blocked while working in other wikis running MediaWiki 1.41 or below. Is there a configuration or parameter I should set? Thanks!

Reply to "Links with templated includes blocked in MW1.42?"

Testing local Redis cache integration with MediaWiki

15
Summary by Nnaka1

@Bawolff Thanks for answering again!

Solution summary: enable debug logging in LocalSettings.php and check that redis is being used in the various caches that MediaWiki uses. (e.g. object cache, parser cache)

Force entries into the cache by executing something like this:

echo "MediaWiki\MediaWikiServices::getInstance()->getMainWANObjectCache()->set( 'keyname', 'value' );" | php maintenance/eval.php

Nnaka1 (talkcontribs)

I have set up a local Redis instance with an open socket. I have followed the instructions here and have made changes in my LocalSettings.php to use it both as an object cache and job queue. However, I have not been seeing any objects or jobs appear when I view the cache contents. I was wondering what the best way to debug / test whether the MediaWiki instance is properly using the cache? Thanks!

My LocalSettings.php contains these configurations:

$'wgMainCacheType' = 'redis';

$'wgObjectCaches'['redis'] = [

'class'                => 'RedisBagOStuff',

'servers'              => [ '...redis.sock' ]

];

$'wgSessionCacheType' = 'redis';

$'wgJobTypeConf'['default'] = [

'class'          => 'JobQueueRedis',

  'redisServer'    => '...redis.sock',

  'redisConfig'    => [],

'claimTTL'       => 3600,

'daemonized'     => true

];

Bawolff (talkcontribs)

first step - enable mediawiki debug logging (see How to debug ) the debug log should list which cache is in use for various things and any errors.

Make sure that "...redis.sock" is correct syntax (i dont know if its right or not. Dont know that much about redis)

Nnaka1 (talkcontribs)

Thanks, @Bawolff!

Following your suggestion, I enabled the debug logging and am seeing the following:

[objectcache] MainWANObjectCache using store RedisBagOStuff

[MessageCache] MessageCache using store RedisBagOStuff

[MessageCache] MessageCache::load: Loading en... local cache is empty, got from global cache

[caches] parser: RedisBagOStuff

Article::view using parser cache: yes

Parser cache options found.

ParserOutput cache found.

Article::view: showing parser cache contents

Which suggests that the redis cache is indeed up. I was wondering whether there is a deterministic way to populate the cache to confirm that it is working as expected.

I tried something simple like refreshing the page to see whether the MessageCache would no longer need to fall back to the "global cache", which I am assuming here refers to the DB.

Bawolff (talkcontribs)

well its saying its serving the current page out of parser cache, and parser cache is backed by redis, so that should mean its populated.

For message cache, not sure, but local cache might mean APCu and global cache redis.

Nnaka1 (talkcontribs)

Thanks for the answer, @Bawolff

Is there a way to force Redis to populate for the different caches (e.g. object, message, and parser).

Based on what you said, I'm quite confident now that the cache is connecting, but for some reason I'm still not seeing any keys appear in the cache, which makes me want to confirm that writing to it is working as expected.

Bawolff (talkcontribs)

you could use eval.php

MediaWiki\MediaWikiServices::getInstance()->getMainWANObjectCache()->get( 'keyname');

And

echo MediaWiki\MediaWikiServices::getInstance()->getMainWANObjectCache()->set( "keyname", "value" );

Nnaka1 (talkcontribs)

Yes, that worked! Also, from playing around, it seems like logging in as the admin and loading / reloading a number of the pages seemed to populate the cache with a few hundred keys.

Keepersdungeon (talkcontribs)

Hello been trying to config Redis for mediawiki 1.41.2 recently but i'm getting

Fatal error: Uncaught error: Class "wikimedia\IPUtils" not found when I run jobrunner as suggested Here on Redis Page.

I've posted my setting here if anyone would like to take a look.

Did u have any issues when u run "php redisJobChronService --config-file=config.json" ?

Bawolff (talkcontribs)

For the fatal error, did you run composer install?

Keepersdungeon (talkcontribs)

Not sure I follow, the command I ran from a terminal in Cpanel. But I used composer to install semantic mediawiki.

You mean should I run composer

php composer.phar update --no-dev

beforehand?

Bawolff (talkcontribs)

Yes, in the directory the job runner service is in.

Keepersdungeon (talkcontribs)

The error is gone but when I run php redisJobChronService --config-file=config.json nothing seems to happen it just stays at NOTICE: Starting job chron loop(s)...

Should I change the dispatcher in the config.json from "nothing" to link to runJobs.php file?

Keepersdungeon (talkcontribs)

if I run php redisJobChronService --config-file=config.json --verbose I get the following messages that gets repeated infinitely

2024-08-07T09:21:38+00:00 DEBUG: Redis cmd: get ["RedisJobChronService::executePeriodicTasks:lock:0"]

2024-08-07T09:21:38+00:00 DEBUG: Redis cmd: getset ["RedisJobChronService::executePeriodicTasks:lock:0",1723022498.49072]

2024-08-07T09:21:38+00:00 DEBUG: Redis cmd: sMembers ["global:jobqueue:s-queuesWithJobs"]

2024-08-07T09:21:38+00:00 DEBUG: Redis cmd: hMSet ["jobqueue:aggregator:h-ready-queues:v2:temp",{"_epoch":1723022498}]

2024-08-07T09:21:38+00:00 DEBUG: Redis cmd: rename ["jobqueue:aggregator:h-ready-queues:v2:temp","jobqueue:aggregator:h-ready-queues:v2"]

2024-08-07T09:21:38+00:00 DEBUG: Redis cmd: del ["RedisJobChronService::executePeriodicTasks:lock:0"]

2024-08-07T09:21:39+00:00 DEBUG: Memory usage: 683848 bytes.


Same for php redisJobRunnerService --config-file=config.json --verbose I get these repeating infinetly

2024-08-07T09:20:56+00:00 DEBUG: Redis cmd: hGetAll ["jobqueue:aggregator:h-ready-queues:v2"]

2024-08-07T09:20:56+00:00 DEBUG: No jobs available...

2024-08-07T09:20:56+00:00 DEBUG: No jobs available...

2024-08-07T09:20:56+00:00 DEBUG: No jobs available...

2024-08-07T09:20:56+00:00 DEBUG: No jobs available...

2024-08-07T09:20:56+00:00 DEBUG: No jobs available...

2024-08-07T09:20:56+00:00 DEBUG: No jobs available...

2024-08-07T09:20:56+00:00 DEBUG: No jobs available...

2024-08-07T09:20:57+00:00 DEBUG: No jobs available...

2024-08-07T09:20:57+00:00 DEBUG: No jobs available...

2024-08-07T09:20:57+00:00 DEBUG: No jobs available...

Keepersdungeon (talkcontribs)

And I also have another question regarding this part

Configure a daemon to run this at server start:

php redisJobChronService --config-file=config.json

How can I configure a daemon to run this?

Apologies in advance for all those questions but it's all a bit confusing if you don't have much experience in this

94.134.181.32 (talkcontribs)

Hi, ich have the same problem, when I run php redisJobChronService --config-file=config.json nothing seems to happen it just stays at NOTICE: Starting job chron loop(s)..., event when i changed the "nothing" to the runJobs.php path in the config.json. Have you already solved the problem?

Reply to "Testing local Redis cache integration with MediaWiki"

SyntaxHighlight Extension 500 error and $wgServer must be set in LocalSettings.php.

1
ACR user (talkcontribs)

Hello,

I am using MediaWiki version 1.39.1 and when I define the SyntaxHighlight_GeSHi extension in LocalSettings.php file, I encounter two separate errors.

Problems I am experiencing:

$wgServer must be set in LocalSettings.php error: I get this error and then I define $wgServer correctly (for example: https://www.docs.clomosy.com). However, when I resolve this error, I encounter a second error.

500 Internal Server Error: I cannot access the page and I get a 500 Internal Server Error error. Because of this error, I have to disable the extension.

Tests I have performed:

When I test the same configuration on my local server with MediaWiki version 1.39.0, everything works fine.

However, I am facing this issue with version 1.39.1 in the live environment.

I have set the $wgServer configuration correctly and checked the file permissions.

When I remove the wfLoadExtension( 'SyntaxHighlight_GeSHi' ); line that I added to the LocalSettings.php file, the site is accessible again.

I kindly ask for your help on what to do about this.

Reply to "SyntaxHighlight Extension 500 error and $wgServer must be set in LocalSettings.php."

ERR_CONNECTION_RESET editing a sub section

3
Darkmatterenergy (talkcontribs)

wikimedia 1.35 on linux debian, php 7.3

what possibly could give a client side ERR_CONNECTION_RESET editing a sub section, no apparent errors server side, editing the entire page works properly, I intentionally disabled https, plain http is enough inside a secure lan

thanks for any hints whatsoever where to look possibly

Ciencia Al Poder (talkcontribs)

Did you look at your webserver error logs (apache error logs, php-fpm process logs...)? A connection reset may indicate the webserver or (more commonly) the php engine crashed while processing the request (usually with a SIGSEV signal, or "segmentation fault"). If that's the case, this may happen due to a buggy php extension installed, sometimes related to php caching.

Darkmatterenergy (talkcontribs)

I have this at the beginning of LocalSettings.php :

error_reporting( E_ALL );

ini_set( 'display_errors', 1 );

and at the end :

$wgShowError = true;

$wgShowErrors = true;

$wgShowSQLError = true;

$wgShowSQLErrors = true;

$wgShowException = true;

$wgShowExceptions = true;

$wgShowExceptionDetails = true;

$wgDebugComments = true;

$wgDebugLogFile = "/var/log/mediawiki/logfile.log";

no errors in /var/log/apache2/error.log

[Tue Sep 17 21:07:31.966640 2024] [mpm_prefork:notice] [pid 1487] AH00163: Apache/2.4.38 (Debian) configured -- resuming normal operations

[Tue Sep 17 21:07:31.966765 2024] [core:notice] [pid 1487] AH00094: Command line: '/usr/sbin/apache2'

in /var/log/mediawiki/logfile.log

I can't find any "error" or "segmentation" what should I look for say "timeout" ?

/var/log/syslog also nothing apparent :

Sep 17 21:07:31 mediawiki1 systemd[1]: Started The Apache HTTP Server.

Sep 17 21:09:00 mediawiki1 systemd[1]: Starting Clean php session files...

Sep 17 21:09:00 mediawiki1 systemd[1]: phpsessionclean.service: Succeeded.

Sep 17 21:09:00 mediawiki1 systemd[1]: Started Clean php session files.

Sep 17 21:09:01 mediawiki1 CRON[1558]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)

Sep 17 21:22:01 mediawiki1 CRON[1566]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Sep 17 21:39:00 mediawiki1 systemd[1]: Starting Clean php session files...

Sep 17 21:39:00 mediawiki1 systemd[1]: phpsessionclean.service: Succeeded.

it is php 7.3, how to configure php-fpm ?

Reply to "ERR_CONNECTION_RESET editing a sub section"

LDAP: User cannot be authenticated

1
Summary last edited by Clump 21:07, 17 September 2024 18 hours ago

We had the wrong casing on searchattribute and usernameattribute.

There was a missing line in the ldap config: 'grouprequest' => 'MediaWiki\\Extension\\LDAPProvider\\UserGroupsRequest\\UserMemberOf::factory'

And we had included these extensions with either missing or lacking config: LDAPGroups and LDAPUserInfo. We just removed them from the install.

We did a lot more, but reverted most of it. This is is the net part of what we had to fix to get it working.

JohnnyBruv (talkcontribs)

Still working on migrating from a 1.35 Mediawiki on Centos 7, to 1.42 on Ubuntu. The Wiki is up and running fine, except for the LDAP connection.

I've tried to follow some guides, and also tried to get to know the different extensions when that didn't work well. I got a lot further from studying them - but not far enough.

When I try to log in with a domain user now, the MediaWiki login feedback is: User cannot be authenticated

In pluggableauth.log:

mediawiki: Getting PluggableAuth instance

mediawiki: Plugin name: LDAPAuthentication2

mediawiki: Authentication failure.

In LDAPAuthentication2.log:

mediawiki: Try to authenticate user: frodobaggins

mediawiki: Not local login. Checking LDAP...

mediawiki: LDAP domain: intratriona.se

mediawiki: Username not found in user info provided by LDAP!Please check LDAP domain configuration. Specifically usernameattribute

mediawiki: LDAP user info results for user frodobaggins: Array

(

<snip>

[samaccountname] => FrodoBaggins

LocalSettings.php and ldapprovider.json are as follows:


LocalSettings.php - LDAP part

wfLoadExtension('PluggableAuth');

wfLoadExtension('LDAPProvider');

wfLoadExtension('LDAPAuthentication2');

wfLoadExtension('LDAPAuthorization');

wfLoadExtension('LDAPUserInfo');

wfLoadExtension('LDAPGroups');

$LDAPProviderDomainConfigs = "/srv/mediawiki/ldapprovider.json";

$LDAPAuthentication2UsernameNormalizer = 'strtolower';

$LDAPAuthorizationAutoAuthUsernameNormalizer = 'strtolower';

$wgLDAPGroupUseFullDN = false; # Use short group names instead of full DNs (optional)

$wgLDAPGroupsPrevail = false;   # LDAP groups take precedence over MediaWiki's internal group settings

$wgPluggableAuth_Config['Domain login'] = [

       'plugin' => 'LDAPAuthentication2',

       'data' => [

           'domain' => 'ourfirm.com',

       ],

];

$wgLDAPPreferences = [

   "ourfirm.com" => [

       "email" => "mail",

       "realname" => "displayname"

       ]

];

------------------------

ldapprovider.json

{

   "ourfirm.com": {

       "connection": {

           "server": "ldaps.ourfirm.com",

           "port": "636",

           "user": "<password",

           "pass": "<username>",

           "enctype": "ssl",

           "options": {

               "LDAP_OPT_DEREF": 1

           },

           "basedn": "DC=ourfirm,DC=com",

           "groupbasedn": "OU=Groups,OU=Tech,DC=ourfirm,DC=com",

           "userbasedn": "OU=Users,OU=Tech,DC=ourfirm,DC=com",

           "searchattribute": "sAMAccountName",

           "usernameattribute": "sAMAccountName",

           "realnameattribute": "displayname",

           "emailattribute": "mail"

       },

       "authorization": {

           "rules": {

               "groups": {

                   "required": ["CN=Tech Users,OU=Admin,DC=ourfirm,DC=com"]

               }

           }

       }

   }

}

Any help with this would be much appreciated!

Load MediaWiki classes in PhpStorm

4
鈴音雨 (talkcontribs)

Hello. I am trying to develop a MediaWiki extension in PhpStorm, but all imports from MediaWiki, such as use MediaWiki\\MediaWikiServices, are recognized as undefined. How can I resolve this?

Samwilson (talkcontribs)

Is your PhpStorm project just the extension directory, or the whole mediawiki directory? I think it's more normally the latter.

鈴音雨 (talkcontribs)

It is open only in the extensions directory.

Samwilson (talkcontribs)

I think it'd be easier to open the project as the whole MediaWiki directory, rather than figure out a way to get PhpStorm to index the rest of the files without doing that. Maybe someone else has a better idea though. :)

Reply to "Load MediaWiki classes in PhpStorm"

Extension for page visit

6
167.103.54.99 (talkcontribs)

Is there any extension that shows when was the page last visited(viewed), so that it helps to track the older pages

Malyacko (talkcontribs)

See your server logs but what is the use case? Going over "unpopular pages" to solve which problem?

Bawolff (talkcontribs)
Jonathan3 (talkcontribs)
167.103.7.14 (talkcontribs)

Thanks for the response!!

HitCounters extension will only show how many times a page has been accessed. We want something like when was it last accessed since we want to remove really old pages which are no longer required. So if there is any extension or any other to track. Thanks in advance!!

Nanash (talkcontribs)

Perhaps the ‘Analytics’ extension would suit you? It includes a page search function and provides a history of both edits and views. But it only provides stats from the moment it is installed.

Reply to "Extension for page visit"

Why is logging in disabled on this wiki?

3
2601:C6:D200:E9B0:6895:D447:CA56:E4C0 (talkcontribs)

Hello. I'm not a creator of a MediaWiki, I'm just here to ask a question. I want to create an account and edit on the Touhou wiki (https://en.touhouwiki.net/wiki/Touhou_Wiki) which was created with MediaWiki (I am NOT a vandal, by the way, I'll probably make a couple of blog posts for my personal Touhou fanworks and edit some typos/things that need to be changed because they're outdated, etc.). It says that registering an account on the wiki is disabled and to do so you have to request it on their Discord server. I do not use Discord and I don't want to go through the pain of making an account and all that stuff just to have an account on the Touhou wiki. I wonder if there's a reason to this, I think it is most likely to prevent vandals (but there could be another reason), and I'm not asking to have one right now, I am just wondering.

Clump (talkcontribs)

You'd have to ask on Touhou_Wiki. This is a different wiki, using the same software, but not administratively connected.

2601:C6:D200:E9B0:6895:D447:CA56:E4C0 (talkcontribs)

I think there's nowhere I can use on the Touhou wiki that I can chat on. There don't seem to be discussions, and you can't edit without an account.

Reply to "Why is logging in disabled on this wiki?"