Project:Support desk

حول هذه الصفحة

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".
2003:C2:3F21:FD00:A1BE:8BA5:2092:924F (نقاشمساهمات)

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?

Bawolff (نقاشمساهمات)

per the Release-notes file included with 1.39, numRows was removed

Use $res->numRows() instead.

TheDJ (نقاشمساهمات)
رد على "1.39.6 function numRows missing"
2003:C2:3F21:FD00:D130:B302:B1E3:AC4 (نقاشمساهمات)

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 (نقاشمساهمات)

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.

Bawolff (نقاشمساهمات)

You need to pass the correct arguments to parent::__construct(). This can change between versions.

You can adjust your special page registration in extension.json to match what WantedQuery does so it gets the same arguments, which you could just pass on. Alternatively you can use the methods of MediaWiki\MediaWikiServices::getInstance() to get the relavent objects.

> According to Mediawiki programming gudelines, the code looks like this

When you say guidelines, is there a specific page you are referencing? I'm asking because if there is incorrect information somewhere i would like to correct it.

TheDJ (نقاشمساهمات)

Seems the signature was accidentally/deliberately changed/broken in REL1_36 https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/ab4d80512c2d5c6d028e885fd66c85f2e6096d14%5E%21/#F1. Probably because people assumed it was unused.

The documentation talks about a special page implementation subclassing the generic SpecialPage class, it is not a general example on how to do that for every single imaginable special page class. The best way to implement this is to, after calling the parent constructor, set $this->mName directly. This is how core classes like SpecialPrefixIndex.php do it.

رد على "1.39 Special Page extensions"
Nexovia (نقاشمساهمات)

I am facing this problem and I have tried opening php.ini file and deleting ; this from extension I am using Xampp local host for all process can somone help to get out fro this.

MediaWiki 1.41 internal error

Installing some PHP extensions is required.

Required components

You are missing a required extension to PHP that MediaWiki requires to run. Please install:

Malyacko (نقاشمساهمات)

You need to install the PHP intl extension. I am not sure how to rephrase the error message to make it clearer, please elaborate what is unclear.

Nexovia (نقاشمساهمات)

The problem as I has mentioned is the exact problem it says for installation of php so how could I do it.

Bawolff (نقاشمساهمات)

What happened when you deleted the ; ?

Did you restart xampp? You have to restart for changes to take effect

Nexovia (نقاشمساهمات)

I have restarted xamppp but it's not working.

رد على "Media Wiki Installing error"

moving data from old version to new version

1
LouiseCooke1 (نقاشمساهمات)

We have a new server where we are installing MediaWiki version 1.41.1.  We also have an older version 1.34.  We need to bring the data from the old version to the new version. What would be the best method for this?  Would exporting the pages from the old version & importing them to the new version be a good solution?

رد على "moving data from old version to new version"
لخّص Шариф Ахмет هذا الموضوع

Thanks. Problem solved.

Шариф Ахмет (نقاشمساهمات)

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 (نقاشمساهمات)

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.

Шариф Ахмет (نقاشمساهمات)

Thanks. Problem solved.

Nexovia (نقاشمساهمات)

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 (نقاشمساهمات)

You would have to take that up with ShoutWiki admins.

Nexovia (نقاشمساهمات)

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

Bawolff (نقاشمساهمات)

We have no control over shoutwiki.

Jack Phoenix (نقاشمساهمات)
لخّص 2003:C2:3F21:FD00:A1BE:8BA5:2092:924F هذا الموضوع

User's mistake, wrong version of ParserFunctions extension.

2003:C2:3F21:FD00:3D09:AB7B:5AC9:BD09 (نقاشمساهمات)

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 (نقاشمساهمات)
[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 (نقاشمساهمات)
2003:C2:3F21:FD00:3D09:AB7B:5AC9:BD09 (نقاشمساهمات)

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 (نقاشمساهمات)

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

Ablum010777 (نقاشمساهمات)

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?

رد على "Upload file size limited to 2 MB"
2003:C2:3F21:FD00:A1BE:8BA5:2092:924F (نقاشمساهمات)
رد على "Popups/TextExtracts 1.39"
Waterlooglass (نقاشمساهمات)

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 (نقاشمساهمات)
  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 (نقاشمساهمات)

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 (نقاشمساهمات)

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

رد على "K8s deploying old image"