Talk:MediaWiki 1.39

About this board

Does medawiki 1.39.6 fix the cve issue ?

5
Luciferindcok (talkcontribs)

we are currently using mediawiki 1.39.4, going to update to 1.39.6 . Please let me know if there are any bugs with this version or is it safe to update.

Matěj Suchánek (talkcontribs)

As of now, 1.39 is LTS, so it should get proper treatment in terms of security updates. The release notes are available.

Luciferindcok (talkcontribs)

I understand that 1.39.6 contains a security update,

Should it be installed the same way we upgrade mediawiki version ?? Is there any easy method to install just the patches?

Matěj Suchánek (talkcontribs)

In theory, it is possible to download just the files that were changed. There is quite a lot of them, though you probably don't need all of them. Otherwise use your version control system and/or follow Manual:Upgrading.

125.16.1.202 (talkcontribs)

thank you

MW 1.39.6 full of null warnings

5
Jakeriper1 (talkcontribs)

"Trying to access array offset on value of type null" is the type of warning i'm getting of several pages.

sooo, why am i getting so many warnings on a LTS, fresh install of MediaWiki?

i installed the wiki on a server with php 8.2. is the LTS not tested on this version of php?

Tacsipacsi (talkcontribs)

MediaWiki 1.39 was released on 30 November 2022, PHP 8.2 eight days later, so no one could test MW 1.39 on PHP 8.2 before the release, and probably no one tested it after the release either.

On the other hand, I don’t know about any changes in PHP 8.2 that could cause these warnings, so it’s likely that it would affect older PHP versions as well. Which file/line do these warnings refer to? Do you have any extensions installed?

Jakeriper1 (talkcontribs)

EDIT: finding more as i work on the wiki:

vendor/wikimedia/wait-condition-loop/src/WaitConditionLoop.php on line 169 (on the main page)

vendor\wikimedia/request-timeout/src/Detail/BasicRequestTimeout.php on line 35

includes/parser/ParserOutput.php on line 1786 (on multiple special pages)

includes/profiler/SectionProfiler.php on line 297


(not sure if there's more - i've seen more, but i've also been installing different MediaWiki versions, and switching PHP versions on my local installation, ir order to upgrade the database of an old wiki to 1.39.6 - maybe i'd have to go through more of the wiki's pages, but these two are quite common on a fresh 1.39.6 MW install with PHP 8.2)


as for extensions i have just a few: JSBreadCrumbs, LinkTitles, WikiEditor and YouTube

Jakeriper1 (talkcontribs)

all these "nulls" have to do with getrusage() or something in that function;

got to dig deeper

Jakeriper1 (talkcontribs)

dunno why the code isn't setting the expected variable as an array here, but the wiki seems working fine, so i'll wait until the next LTS and upgrade, hopefully this will be fixed by then.

i just hid the error, if anyone's interested, with isset and is_array.


if (isset($ru) || is_array($ru)) { run whatever the function has to run that uses $ru }

Reply to "MW 1.39.6 full of null warnings"
בקש (talkcontribs)

I updated from 1.38.4 to 1.39.4 and raned the update script, the script exits withe the following error:

Modifying tl_namespace field of table templatelinks...Wikimedia\Rdbms\DBQueryError from line 1618 of /var/www/html/w/includes/libs/rdbms/database/Database.php: Error 1091: Can't DROP INDEX `PRIMARY`; check that it exists
Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/w/maintenance/archives/patch-templatelinks-tl_title-nullable.sql )
Query: ALTER TABLE  `mw_templatelinks`
DROP  PRIMARY KEY


# 0 /var/www/html/w/includes/libs/rdbms/database/Database.php(1602): Wikimedia\Rdbms\Database->getQueryException('Can't DROP INDE...', 1091, 'ALTER TABLE  `m...', 'Wikimedia\\Rdbms...')
# 1 /var/www/html/w/includes/libs/rdbms/database/Database.php(1576): Wikimedia\Rdbms\Database->getQueryExceptionAndLog('Can't DROP INDE...', 1091, 'ALTER TABLE  `m...', 'Wikimedia\\Rdbms...')
# 2 /var/www/html/w/includes/libs/rdbms/database/Database.php(952): Wikimedia\Rdbms\Database->reportQueryError('Can't DROP INDE...', 1091, 'ALTER TABLE  `m...', 'Wikimedia\\Rdbms...', false)
# 3 /var/www/html/w/includes/libs/rdbms/database/Database.php(3302): Wikimedia\Rdbms\Database->query('ALTER TABLE  `m...', 'Wikimedia\\Rdbms...')
# 4 /var/www/html/w/includes/libs/rdbms/database/Database.php(3241): Wikimedia\Rdbms\Database->sourceStream(Resource id #1341, NULL, NULL, 'Wikimedia\\Rdbms...', NULL)
# 5 /var/www/html/w/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\Database->sourceFile('/var/www/html/w...')
# 6 /var/www/html/w/includes/libs/rdbms/database/DBConnRef.php(807): Wikimedia\Rdbms\DBConnRef->__call('sourceFile', Array)
# 7 /var/www/html/w/includes/installer/DatabaseUpdater.php(718): Wikimedia\Rdbms\DBConnRef->sourceFile('/var/www/html/w...')
# 8 /var/www/html/w/includes/installer/DatabaseUpdater.php(1000): DatabaseUpdater->applyPatch('/var/www/html/w...', false, 'Modifying tl_na...')
# 9 /var/www/html/w/includes/installer/DatabaseUpdater.php(547): DatabaseUpdater->modifyField('templatelinks', 'tl_namespace', 'patch-templatel...')
# 10 /var/www/html/w/includes/installer/DatabaseUpdater.php(511): DatabaseUpdater->runUpdates(Array, false)
# 11 /var/www/html/w/maintenance/update.php(202): DatabaseUpdater->doUpdates(Array)
# 12 /var/www/html/w/maintenance/includes/MaintenanceRunner.php(309): UpdateMediaWiki->execute()
# 13 /var/www/html/w/maintenance/doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run()
# 14 /var/www/html/w/maintenance/update.php(312): require_once('/var/www/html/w...')
# 15 {main}

what can i do to fix it?

Prod (talkcontribs)

Did you run the updater twice? I think I had a similar problem. The first time I ran it, it errored half way through the script, and then the second time it couldn't drop the index.

You might be able to get past this by recreating the index.

Pipsteer (talkcontribs)

We're running into the same issue on our wiki, updating to 1.39.3. Oddly enough most of the wiki funcionality is still without problems. I'll let you know what happens after recreating the index

Pipsteer (talkcontribs)

I found the relevant SQL commands in

~/public_html/maintenance/archives/patch-templatelinks-tl_title-nullable.sql


I tried to recreate the primary key like they did there, but got the following response:

Duplicate entry '568-1' for key 'PRIMARY'

Pipsteer (talkcontribs)

update: I found a similar problem described in https://phabricator.wikimedia.org/T332333 . After following the steps of this user to resolve the issue, update.php worked for me as well. It seems that some old templatelink entries were created with empty title fields, which make the primary key assignment impossible due to duplicates.

After clearing the duplicate entries with empty titles in the database, my issue was resolved.

בקש (talkcontribs)

On the mean time i downgraded back to 1.38.4 because my whole website crashed (the db refused the server connection) and lost 1500 edits of my users. I gonna try what you did here hope this helps me. Thanks

Reply to "update.php fails"

Main slot of revision not found in database. See T212428

2
147.235.195.179 (talkcontribs)

I updated from version 1.33.0 to version 1.39.3 and I have this error:

Original exception: [21dbfcdc763b93fdb3cf967d] /index.php/Accueil MediaWiki\Revision\RevisionAccessException: Main slot of revision not found in database. See T212428.

Backtrace:

from D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\Revision\RevisionStore.php(1518)

#0 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\Revision\RevisionStore.php(1377): MediaWiki\Revision\RevisionStore->constructSlotRecords(integer, array, integer, Title)

#1 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\Revision\RevisionStore.php(1554): MediaWiki\Revision\RevisionStore->loadSlotRecords(integer, integer, Title)

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

#3 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\Revision\RevisionSlots.php(170): call_user_func(Closure)

#4 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\Revision\RevisionSlots.php(109): MediaWiki\Revision\RevisionSlots->getSlots()

#5 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\Revision\RevisionRecord.php(181): MediaWiki\Revision\RevisionSlots->getSlot(string)

#6 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\page\WikiPage.php(673): MediaWiki\Revision\RevisionRecord->getSlot(string, integer)

#7 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\libs\objectcache\wancache\WANObjectCache.php(1689): WikiPage->{closure}(boolean, integer, array, NULL, array)

#8 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\libs\objectcache\wancache\WANObjectCache.php(1522): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array, array)

#9 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\page\WikiPage.php(687): WANObjectCache->getWithSetCallback(string, integer, Closure, array)

#10 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\page\WikiPage.php(296): WikiPage->getContentModel()

#11 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\MediaWiki.php(437): WikiPage->getContentHandler()

#12 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\MediaWiki.php(320): MediaWiki->initializeArticle()

#13 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\MediaWiki.php(904): MediaWiki->performRequest()

#14 D:\wamp64.3.3.0\www\mediawiki-1.39.3\includes\MediaWiki.php(562): MediaWiki->main()

#15 D:\wamp64.3.3.0\www\mediawiki-1.39.3\index.php(50): MediaWiki->run()

#16 D:\wamp64.3.3.0\www\mediawiki-1.39.3\index.php(46): wfIndexMain()

#17 {main}


What can I do to fix it? All clues found on the web are for older versions.

Jdforrester (WMF) (talkcontribs)

I believe that running php maintenance/findBadBlobs.php should still help, but that advice might be out of date as you say.

Reply to "Main slot of revision not found in database. See T212428"

PHP error while editing pages

1
123.136.150.182 (talkcontribs)

@Jdforrester (WMF) Hi, I upgraded my wiki to 1.39 but when I'm using PHP 8.0 I'm getting the following error while editing the pages "Fatal exception of type "TypeError"" I looked at the error log and found "TypeError: Cannot access offset of type string on string" is there a bug or something? if not then is there a solution?

Thank you

Reply to "PHP error while editing pages"

Add option to import to allow prepend, and appending

2
Proactive programming (talkcontribs)

Can the option be added to import that will allow the option to prepend or append a record instead of overwriting? And allow the option to skip a record if there is a duplicate? Similar to the functionality of the "data transfer" extension". Also having the option to import to an existing section (by name) or a new section would also be great.

Jdforrester (WMF) (talkcontribs)
Reply to "Add option to import to allow prepend, and appending"
Proactive programming (talkcontribs)

"When importing revision with same timestamp as latest revision, treat  it as the new latest." -- this is going to cause problems when trying to import large files and there is an error, so the file needs to be imported. That means if you already successfully imported 3000 records, and 3001 had the error, all the successful 3000 records will be imported. This should be an option.

Jdforrester (WMF) (talkcontribs)
Reply to "Changes to import"
Tacsipacsi (talkcontribs)

I think this page should note that now PHP 7.4 is required (and probably the level of PHP 8.0/8.1 support; where are we yet?). I don’t know where to put and how to formulate this piece of information, though, so if anyone can include it, thanks in advance!

Jdforrester (WMF) (talkcontribs)

Yeah, this page and the main release notes page have both been filled out prematurely, and miss out on the wording. We'll probably re-sync them when we're pushing the actual release.

Jdforrester (WMF) (talkcontribs)
There are no older topics