Project:Support desk

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(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 versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. 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.
  3. To start a new thread, click "Start a new topic".

'Background' code is not supported

3
Summary by Шариф Ахмет

Thanks. Problem solved.

Шариф Ахмет (talkcontribs)

After moving our site to another server, a problem occurred. If a page of the site has 'background' code, it is now not possible to edit that page. This error occurs:

'403 Forbidden Access to this resource on the server is denied!'

https://sheki.org/wiki/index.php?title=%C5%9Eablon:15_aprel&action=submit

But after deleting the "background" code on that page, everything is fine. How to solve this problem?

Jack Phoenix (talkcontribs)

Judging by some quick googling, it sounds like a problem with mod_security (no surprise there...). Try disabling it or if you don't have the access to do that, contact your hosting company to do so.

Шариф Ахмет (talkcontribs)

Thanks. Problem solved.

Nexovia (talkcontribs)

The Wiki as I have already talked about Shout Wiki I actually exactly not know that the founder of wiki should update wiki version or it can be done with MW Shout Wiki was just emerging wiki host but due to their own founder and staffs became inactive so I would know what should be done now.

Bawolff (talkcontribs)

You would have to take that up with ShoutWiki admins.

Nexovia (talkcontribs)

There is no single admin active or Stewards or Staff none is active that's why I am asking here for a way.

Bawolff (talkcontribs)

We have no control over shoutwiki.

Jack Phoenix (talkcontribs)

1.39 Special Page extensions

2
2003:C2:3F21:FD00:D130:B302:B1E3:AC4 (talkcontribs)

Some of our own extensions are based on existing special pages. According to Mediawiki programming gudelines, the code looks like this:

class WantedPagesNeo extends WantedPagesPage {

        function __construct( $name = 'WantedPages_(PR_Neo)' ) {
                parent::__construct( $name );
        }

...

Prior to 1.39, this used to work but now it crashes:

[739319141d78cf5548ef724f] /wiki/Spezial:Spezialseiten TypeError: Argument 1 passed to WantedPagesPage::__construct() must implement interface Wikimedia\Rdbms\ILoadBalancer, string given, called in /var/www/test/mediawiki/extensions/PPaddons/src/SpecialPages/WantedPagesNeo.php on line 26

Backtrace:

from /var/www/test/mediawiki/includes/specials/SpecialWantedpages.php(39)
#0 /var/www/test/mediawiki/extensions/PPaddons/src/SpecialPages/WantedPagesNeo.php(26): WantedPagesPage->__construct()
#1 /var/www/test/mediawiki/vendor/wikimedia/object-factory/src/ObjectFactory.php(247): PP\SpecialPages\WantedPagesNeo->__construct()
#2 /var/www/test/mediawiki/vendor/wikimedia/object-factory/src/ObjectFactory.php(152): Wikimedia\ObjectFactory\ObjectFactory::getObjectFromSpec()
#3 /var/www/test/mediawiki/includes/specialpage/SpecialPageFactory.php(1279): Wikimedia\ObjectFactory\ObjectFactory->createObject()
#4 /var/www/test/mediawiki/includes/specialpage/SpecialPageFactory.php(1314): MediaWiki\SpecialPage\SpecialPageFactory->getPage()
#5 /var/www/test/mediawiki/includes/specials/SpecialSpecialpages.php(53): MediaWiki\SpecialPage\SpecialPageFactory->getUsablePages()
#6 /var/www/test/mediawiki/includes/specials/SpecialSpecialpages.php(42): SpecialSpecialpages->getPageGroups()
#7 /var/www/test/mediawiki/includes/specialpage/SpecialPage.php(701): SpecialSpecialpages->execute()
#8 /var/www/test/mediawiki/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
#9 /var/www/test/mediawiki/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#10 /var/www/test/mediawiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
#11 /var/www/test/mediawiki/includes/MediaWiki.php(562): MediaWiki->main()
#12 /var/www/test/mediawiki/index.php(50): MediaWiki->run()
#13 /var/www/test/mediawiki/index.php(46): wfIndexMain()
#14 {main}

What does it mean and where can I find documentation on how to correct it?

Jack Phoenix (talkcontribs)

This is a Dependency Injection (DI) related issue.

If you look at the source code of SpecialWantedpages.php as of REL1_39, you'll notice that the constructor's function signature has changed. These kind of changes are all over the place and will be in the future as well. Honestly, it's a mess.

Anyway, try changing your code to something like this, maybe:

	function __construct() {
		WantedQueryPage::__construct( 'WantedPages_(PR_Neo)' );
	}

This may or may not work (also, I should note that the use of parentheses in a special page name like that is quite unusual). Having access to the actual code would aid in debugging.

Someone who understand's MW's DI and its current state can probably chime in and explain it more and better.

Reply to "1.39 Special Page extensions"
Summary by 2003:C2:3F21:FD00:A1BE:8BA5:2092:924F

User's mistake, wrong version of ParserFunctions extension.

2003:C2:3F21:FD00:3D09:AB7B:5AC9:BD09 (talkcontribs)

Done. Migration failed for 9 row(s).


Very cool error message. Everything is absolutely clear at the first glance.

scnr

2003:C2:3F21:FD00:3D09:AB7B:5AC9:BD09 (talkcontribs)
[error] [ba7e546ea33fc2ecb983341e] /wiki/Hauptseite   PHP Unknown error: Cannot access non-public property Parser::$mOutp

ut

#0 [internal function]: MWExceptionHandler::handleError()

#1 /var/www/test/mediawiki/includes/debug/DeprecationHelper.php(202): trigger_error()

#2 /var/www/test/mediawiki/extensions/ParserFunctions/includes/ParserFunctions.php(388): Parser->__get()

#3 /var/www/test/mediawiki/extensions/ParserFunctions/includes/ParserFunctions.php(414): MediaWiki\Extensions\ParserFunct

ions\ParserFunctions::ifexistInternal()

#4 /var/www/test/mediawiki/includes/parser/Parser.php(3437): MediaWiki\Extensions\ParserFunctions\ParserFunctions::ifexis

t()

#5 /var/www/test/mediawiki/includes/parser/Parser.php(3122): Parser->callParserFunction()

#6 /var/www/test/mediawiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

#7 /var/www/test/mediawiki/includes/parser/Parser.php(3313): PPFrame_Hash->expand()

#8 /var/www/test/mediawiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

#9 /var/www/test/mediawiki/includes/parser/Parser.php(3030): PPFrame_Hash->expand()

#10 /var/www/test/mediawiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

#11 /var/www/test/mediawiki/includes/parser/Parser.php(3313): PPFrame_Hash->expand()

#12 /var/www/test/mediawiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

#13 /var/www/test/mediawiki/includes/parser/PPTemplateFrame_Hash.php(97): PPFrame_Hash->expand()

#14 /var/www/test/mediawiki/includes/parser/Parser.php(3310): PPTemplateFrame_Hash->cachedExpand()

#15 /var/www/test/mediawiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

#16 /var/www/test/mediawiki/includes/parser/PPTemplateFrame_Hash.php(97): PPFrame_Hash->expand()

#17 /var/www/test/mediawiki/includes/parser/Parser.php(3310): PPTemplateFrame_Hash->cachedExpand()

#18 /var/www/test/mediawiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

#19 /var/www/test/mediawiki/includes/parser/Parser.php(2951): PPFrame_Hash->expand()

#20 /var/www/test/mediawiki/includes/parser/Parser.php(1609): Parser->replaceVariables()

#21 /var/www/test/mediawiki/includes/parser/Parser.php(723): Parser->internalParse()

#22 /var/www/test/mediawiki/includes/content/WikitextContentHandler.php(301): Parser->parse()

#23 /var/www/test/mediawiki/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()

#24 /var/www/test/mediawiki/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()

#25 /var/www/test/mediawiki/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()

#26 /var/www/test/mediawiki/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()

#27 /var/www/test/mediawiki/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()

#28 /var/www/test/mediawiki/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()

#29 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()

#30 /var/www/test/mediawiki/includes/Revision/RenderedRevision.php(199): call_user_func()

#31 /var/www/test/mediawiki/includes/poolcounter/PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()

#32 /var/www/test/mediawiki/includes/poolcounter/PoolWorkArticleViewCurrent.php(97): PoolWorkArticleView->renderRevision()

#33 /var/www/test/mediawiki/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleViewCurrent->doWork()

#34 /var/www/test/mediawiki/includes/page/ParserOutputAccess.php(299): PoolCounterWork->execute()

#35 /var/www/test/mediawiki/includes/page/Article.php(714): MediaWiki\Page\ParserOutputAccess->getParserOutput()

#36 /var/www/test/mediawiki/includes/page/Article.php(528): Article->generateContentOutput()

#37 /var/www/test/mediawiki/includes/actions/ViewAction.php(78): Article->view()

#38 /var/www/test/mediawiki/includes/MediaWiki.php(542): ViewAction->show()

#39 /var/www/test/mediawiki/includes/MediaWiki.php(322): MediaWiki->performAction()

#40 /var/www/test/mediawiki/includes/MediaWiki.php(904): MediaWiki->performRequest()

#41 /var/www/test/mediawiki/includes/MediaWiki.php(562): MediaWiki->main()

#42 /var/www/test/mediawiki/index.php(50): MediaWiki->run()

#43 /var/www/test/mediawiki/index.php(46): wfIndexMain()

#44 {main}

[exception] [ba7e546ea33fc2ecb983341e] /wiki/Hauptseite   PHP Fatal Error from line 202 of /var/www/test/mediawiki/includes/debug/DeprecationHelper.php: Cannot access non-public property Parser::$mOutput

#0 [internal function]: MWExceptionHandler::handleFatalError()

#1 {main}

[session] Saving all sessions on shutdown

Nice backtrace but it does not show what's the problem. How can i find out which component is wrong?

Bawolff (talkcontribs)
2003:C2:3F21:FD00:3D09:AB7B:5AC9:BD09 (talkcontribs)

Huh ...! No it's been the wrong version. Sorry for that. I thought ParserFunctions is part of the Mediawiki installation bundle.

Solved, thank you very much!

Bawolff (talkcontribs)

It normally is, but there are different bundles you can get some of which don't include extensions.

1.39.6 function numRows missing

1
2003:C2:3F21:FD00:A1BE:8BA5:2092:924F (talkcontribs)

According to Manual:Database.php#Functions, we use the following code (extract):

$dbr = wfGetDB( DB_REPLICA );
$res = $dbr->query( ... some DB Query ... );
.... $dbr->numRows( $res ) ....

But we get:

Error: Call to undefined method Wikimedia\Rdbms\DatabaseMysqli::numRows()

Backtrace:

from /var/www/test/mediawiki/includes/libs/rdbms/database/DBConnRef.php(103)
#0 /var/www/test/mediawiki/extensions/PPcheckRedirects/SpecialPPcheckRedirects.class.php(118): Wikimedia\Rdbms\DBConnRef->__call()
#1 /var/www/test/mediawiki/includes/specialpage/SpecialPage.php(701): SpecialPPcheckRedirects->execute()
#2 /var/www/test/mediawiki/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
#3 /var/www/test/mediawiki/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#4 /var/www/test/mediawiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
#5 /var/www/test/mediawiki/includes/MediaWiki.php(562): MediaWiki->main()
#6 /var/www/test/mediawiki/index.php(50): MediaWiki->run()
#7 /var/www/test/mediawiki/index.php(46): wfIndexMain()
#8 {main}

Prior to 1.39, the above code worked. Could this be an installation problem or has there been an undocumented redesign of the db access objects?

Reply to "1.39.6 function numRows missing"

Upload file size limited to 2 MB

1
Ablum010777 (talkcontribs)

I have set the maximum upload file size to 150M as well as my post max size.

This is what my site configuration of the web server says:

php_value upload_max_filesize 150M

php_value post_max_size 150M

In my LocalSettings.php I set

$wgMaxUploadSize = 150*1024*1024;

But the wiki still shows me a file upload maximum size of 2 MB. Am I missing something?

Reply to "Upload file size limited to 2 MB"

Popups/TextExtracts 1.39

1
2003:C2:3F21:FD00:A1BE:8BA5:2092:924F (talkcontribs)
Reply to "Popups/TextExtracts 1.39"

K8s deploying old image

4
Waterlooglass (talkcontribs)

Hello,

I'm deploying the bitnami/mediawiki via Kubernetes. I am noticing issues in which I deploy an image that has an error, i fix the error and push a new image, my updated deployment will call that new image, but still reference the prior error.


For example, I misconfigured OIDC Connect Extension and so the depoyment failed. I created a new image and removed OIDC Extension in order to start fresh, and when I deploy the new image, it still references the previous OIDC Error even though this new image has no reference to that extension. Does mediawiki have a caching mechanism that would prevent K8s from deploying the new image?

TheDJ (talkcontribs)
  1. We are not familiar with the bitnami package, so it is hard to advise about it.
  2. MediaWiki does extensive caching. If your server does not expunge its in-memory caches, or if you use a CDN and you are not logged in, then it might be possible you see some sort of cached state.
  3. What is the error you are seeing ?
Waterlooglass (talkcontribs)

Here is the error, I am assuming you are correct in that it is a caching issue. Is it possible that the old images are stored in my PVC mount? somehow? the OIDCConnect Extension is not loaded on the new image I have deployed, nor am I calling it anywhere within that image.


Error: The OIDCConnect extension cannot be loaded. Check that all of its files are installed properly.

#0 /opt/bitnami/mediawiki/includes/GlobalFunctions.php(54): ExtensionRegistry->queue()
#1 /bitnami/mediawiki/LocalSettings.php(158): wfLoadExtension()
#2 /opt/bitnami/mediawiki/includes/Setup.php(212): require_once('...')
#3 /opt/bitnami/mediawiki/maintenance/doMaintenance.php(83): require_once('...')
#4 /opt/bitnami/mediawiki/maintenance/update.php(298): require_once('...')
#5 {main}
[17-Apr-2024 19:35:01 UTC] PHP Fatal error:  Error Loading extension. Unable to open file /opt/bitnami/mediawiki/extensions/OIDCConnect/extension.json: filemtime(): stat failed for /opt/bitnami/mediawiki/extensions/OIDCConnect/extension.json in /opt/bitnami/mediawiki/includes/registration/MissingExtensionException.php on line 100
TheDJ (talkcontribs)

This sounds like your LocalSettings.php is still attempting to load in the extension you removed.

Reply to "K8s deploying old image"

Is it possible to delete my account ?

2
Anthonypauwels14 (talkcontribs)

Hello, I want my account to be deleted. Thanks.

Bawolff (talkcontribs)
Reply to "Is it possible to delete my account ?"

Lua error in Module:Citation/CS1/Configuration at line 2058: attempt to index field '?' (a nil value).

4
Zied dhf (talkcontribs)

Hello everyone!

We are running our wiki, mediawiki version 1.42.0-wmf.23, PHP 8.1.2-1ubuntu2.14 (fpm-fcgi), MariaDB 10.6.16-MariaDB-0ubuntu0.22.04.1-log.

Lately when we import any article that contains citations such as { { cite book } , { { cite journal } } etc.. for example it contains a line like the following "{ { cite book | title = test book } }",

Instead of displaying "test book" it generates a lua error :

Lua error in Module:Citation/CS1/Configuration at line 2058: attempt to index field '?' (a nil value).

Backtrace:

  1. Module:Citation/CS1/Configuration:2058: in function "init"
  2. package.lua:103: ?
  3. (tail call): ?
  4. mw.lua:496: in function "executeModule"
  5. mw.lua:768: in function "loadData"
  6. Module:Citation/CS1:4394: in function "chunk"
  7. mw.lua:527: ?
  8. [C]: ?


We have been using mediawiki for more than 6 months and this issue only happened in past month.

I appreciate any guidance to identify the problem and solve it.

Wargo (talkcontribs)

You need to install Extension:JsonConfig and import also data from Commons or modify module to not use them or disable some of its features.

As I can see in phab:T362754 it is resolved now.

Zied dhf (talkcontribs)
Zied dhf (talkcontribs)

Thanks a lot Wargo!