Topic on Project:Support desk

Error running refreshLinks.php

7
Buman (talkcontribs)

MediaWiki 1.33.1

PHP 7.3.11 (cgi-fcgi)

MariaDB 10.3.17-MariaDB-1:10.3.17+maria~bionic

Wiki URL: http://www.seigmen.no/

Wiki Languate: Norwegian


Updating from 1.25.3 to 1.33.1 there have apparently been som encoding issuses, where pages having titles with non ASCII characters simply won't show. I've managed to locate pages being orphaned by this problem: http://www.seigmen.no/index.php?title=Spesial%3AForeldrel%C3%B8se_sider&limit=250&offset=0

Searching for a solution I came to the conlusion that the running of rebuildall.php / refreshLinks.php was needed. Unfortunately I can't get refreshLinks.php to work

> php refreshLinks.php

Refreshing redirects table.
Starting from page_id 1 of 915.
100
200
300
400
500
600
700
800
900
Refreshing links tables.
Starting from page_id 1 of 915.
[ad957bb037931af4f1c02f5b] [no req]   Error from line 3676 of ../httpd.www/includes/page/WikiPage.php: Call to a member function refreshCountsIfEmpty() on bool
Backtrace:
#0 ../httpd.www/includes/deferred/MWCallableUpdate.php(34): WikiPage->{closure}()
#1 ../httpd.www/includes/deferred/DeferredUpdates.php(274): MWCallableUpdate->doUpdate()
#2 ../httpd.www/includes/deferred/DeferredUpdates.php(231): DeferredUpdates::runUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactorySimple, string, integer)
#3 ../httpd.www/includes/deferred/DeferredUpdates.php(143): DeferredUpdates::execute(array, string, integer)
#4 ../httpd.www/includes/deferred/DeferredUpdates.php(313): DeferredUpdates::doUpdates(string)
#5 ../httpd.www/includes/deferred/DeferredUpdates.php(104): DeferredUpdates::tryOpportunisticExecute(string)
#6 ../httpd.www/includes/Storage/DerivedPageDataUpdater.php(1601): DeferredUpdates::addUpdate(LinksUpdate, integer)
#7 ../httpd.www/includes/page/WikiPage.php(2134): MediaWiki\Storage\DerivedPageDataUpdater->doSecondaryDataUpdates(array)
#8 ../httpd.www/maintenance/refreshLinks.php(275): WikiPage->doSecondaryDataUpdates(array)
#9 ../httpd.www/maintenance/refreshLinks.php(198): RefreshLinks::fixLinksFromArticle(integer, boolean)
#10 ../httpd.www/maintenance/refreshLinks.php(83): RefreshLinks->doRefreshLinks(integer, boolean, string, boolean, boolean)
#11 ../httpd.www/maintenance/doMaintenance.php(96): RefreshLinks->execute()
#12 ../httpd.www/maintenance/refreshLinks.php(491): require_once(string)
#13 {main}

Any ideas?

Osnard (talkcontribs)

You are right. This is probably some encoding issue. Can you give insight on what is set in your wikis configuration for $wgDBTableOptions and what is actually set in your database (e.g. run SHOW CREATE TABLE page;)?

You might also try to truncate the "secondary links" tables categorylinks, externallinks and pagelinks. Run php maintenance/rebuildall.php afterwards. Make sure you have a backup of your database.

Buman (talkcontribs)

Truncating categorylinks, externallinks and pagelinks did the trick. I was now able to run php maintenance/rebuildall.php

But I'm still facing issues with dead links / pages with non-ASCII not showing up.


Regardring....

LocalSettings.php

# MySQL table options to use during installation or update
$wgDBTableOptions   = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

Database

Since my post here, I have tried to change the encoding on the "page" table from latin1 to utf8mb4 (It's named "wikipage" in my database); Currently it looks like this:

CREATE TABLE `wikipage` ( `page_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `page_namespace` int(11) NOT NULL,
 `page_title` varbinary(255) NOT NULL,
 `page_restrictions` tinyblob NOT NULL,
 `page_is_redirect` tinyint(3) unsigned NOT NULL DEFAULT 0,
 `page_is_new` tinyint(3) unsigned NOT NULL DEFAULT 0,
 `page_random` double unsigned NOT NULL,
 `page_touched` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
 `page_latest` int(10) unsigned NOT NULL,
 `page_len` int(10) unsigned NOT NULL,
 `page_content_model` varbinary(32) DEFAULT NULL,
 `page_links_updated` varbinary(14) DEFAULT NULL,
 `page_lang` varbinary(35) DEFAULT NULL,
 PRIMARY KEY (`page_id`),
 UNIQUE KEY `name_title` (`page_namespace`,`page_title`),
 KEY `page_random` (`page_random`),
 KEY `page_len` (`page_len`),
 KEY `page_redirect_namespace_len` (`page_is_redirect`,`page_namespace`,`page_len`)
 ENGINE=MyISAM AUTO_INCREMENT=916 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

I tried changing back to latin1 and running php maintenance/rebuildall.php a second time. But that didn't make any difference.

Kyr (talkcontribs)

I have exactly the same problem.

Running

PHP 7.0.33-0+deb9u6 (apache2handler)

MariaDB 10.1.41-MariaDB-0+deb9u1

while upgrading from Mediawiki 1.32.1 to 1.33.1.

After upgrading pages having titles with non ASCII characters simply won't show.


I'd executed refreshLinks.php and got exaxtly the same error.

[no req] Error from line 3676 of ../httpd.www/includes/page/WikiPage.php: Call to a member function refreshCountsIfEmpty() on boolean.


$wgDBTableOptions = "ENGINE=InnoDB";

Maybe a problem with the old

$wgDBMysql5 = true;

which is now removed?

Buman (talkcontribs)

Kyr, tid you try (SQL)

TRUNCATE TABLE categorylinks;
TRUNCATE TABLE externallinks;
TRUNCATE TABLE pagelinks;

And then running php maintenance/rebuildall.php ? That should at least eliminate the problem with

Error from line 3676 of ../httpd.www/includes/page/WikiPage.php: Call to a member function refreshCountsIfEmpty() on boolean.
Kyr (talkcontribs)

No, I did not truncate the tables. First I had to fight that character encoding problem. When installing MW a long time ago it set's $wgDBMysl5 = true; in the Localsettings.php. Now this is removed and that breaks my wiki. After that I'll check that rebuildall.php - problem. In my opinion it should be solved as well after solving the character encoding problem.

But many thanks for your answer.

Kyr (talkcontribs)

As I mentioned above: after fixing the character encoding problem everything works fine. No need to truncate any tables.

Reply to "Error running refreshLinks.php"