Topic on Project:Support desk

MediaWiki 1.22 causes error: Invalid magic word "rootpagename"

28
Pchelinov.a (talkcontribs)

Hi! I am from Russia, sorry to my English. I have a problem with update. Short text of error 'invalid magic word 'rootpagename

Version MediaWiki 1.22

Backtrace:

#0 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\MagicWord.php(238): MagicWord->load('rootpagename')
#1 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\parser\Parser.php(4919): MagicWord::get('rootpagename')
#2 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\parser\CoreParserFunctions.php(91): Parser->setFunctionHook('rootpagename', Array, 1)
#3 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\parser\Parser.php(267): CoreParserFunctions::register(Object(Parser))
#4 [internal function]: Parser->firstCallInit()
#5 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\StubObject.php(79): call_user_func_array(Array, Array)
#6 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\StubObject.php(99): StubObject->_call('firstCallInit', Array)
#7 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\cache\MessageCache.php(996): StubObject->__call('firstCallInit', Array)
#8 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\cache\MessageCache.php(996): StubObject->firstCallInit()
#9 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\cache\MessageCache.php(974): MessageCache->getParser()
#10 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Message.php(696): MessageCache->transform('$1 ??? {{SITENA...', true, Object(LanguageRu), Object(Title))
#11 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Message.php(496): Message->transformText('$1 ??? {{SITENA...')
#12 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Message.php(553): Message->toString()
#13 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\OutputPage.php(846): Message->text()
#14 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\OutputPage.php(889): OutputPage->setHTMLTitle(Object(Message))
#15 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Article.php(555): OutputPage->setPageTitle('???????????????...')
#16 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\actions\ViewAction.php(44): Article->view()
#17 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Wiki.php(439): ViewAction->show()
#18 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#19 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Wiki.php(565): MediaWiki->performRequest()
#20 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\includes\Wiki.php(458): MediaWiki->main()
#21 C:\Program Files (x86)\OTRS\Apache\htdocs\wiki\index.php(55): MediaWiki->run()
#22 {main}
88.130.81.37 (talkcontribs)

Hi!

The magic word "rootpagename" has been added in MediaWiki 1.22, see Release_notes/1.22 and bug 6747. Btw way final version of MediaWiki 1.22 has not yet been released. Maybe you are using an older version (an older RC or a beta version), which does not yet contain this new magic word?

120.147.16.155 (talkcontribs)

Maybe so, but after upgrade from 1.21.3 to 1.22.0 I get: [9f34ab5a] /index.php/Main_Page Exception from line 316 of /var/www/html/mediawiki-1.22.0/includes/MagicWord.php: Error: invalid magic word 'rootpagename'

I've simply downloaded mediawiki-1.22.0.tar.gz; expanded it into /var/www/html/mediawiki-1.22.0; copied LocalSettings.php and images from previous version; run php update.php in maintenance.

120.147.16.155 (talkcontribs)
120.147.16.155 (talkcontribs)
120.147.16.155 (talkcontribs)

RELEASE-NOTES-1.22 states that MediaWiki 1.22 is an alpha-quality branch and is not recommended for use in production. That's probably right!

90.215.111.103 (talkcontribs)

It was released yesterday

91.52.193.216 (talkcontribs)

I confirm the same behaviour on my installation. Web upgrade from 1.20.2 to 1.22.0 results in the bespoke error:

"[642fd5f3] /wiki/index.php/Main_Page Exception from line 316 of /var/www/mediawiki-1.22.0/includes/MagicWord.php: Error: invalid magic word 'rootpagename'"

and same stacktrace as written in first post.

Ciencia Al Poder (talkcontribs)

I see you're using russian language. I remember seeing similar problems for older versions too. Maybe you need to run rebuildLocalisationCache.php --force

203.206.131.20 (talkcontribs)

The RELEASE-NOTES-1.22 file in the current download at http://www.mediawiki.org/wiki/Download still says:

== MediaWiki 1.22 ==

THIS IS NOT A RELEASE YET

MediaWiki 1.22 is an alpha-quality branch and is not recommended for use in production.

88.130.110.231 (talkcontribs)

This has been fixed inbetween; Download does no longer contain this text.

203.206.131.20 (talkcontribs)

Not for me. Still the above mentioned text.

194.77.167.34 (talkcontribs)
Ciencia Al Poder (talkcontribs)
88.130.127.250 (talkcontribs)

Phh, a forgotten line. If a sack of rice falls in China, it's a bigger problem. Honestly guys!

However, it is in fact not the first time that such problems after a major release happen. E.g. the version, which was published as "1.21.0" still showed the version number 1.21.0.rc3. Maybe there really is still room for improvement.

So what about the invalid magic word "rootpagename"?

194.77.167.34 (talkcontribs)

Yeah honestly. I do not care about a forgotten line of README text. Question is: Was that line simply forgotten or did someone mess something (else) up?

I ran an upgrade on a very basic wiki installation (no additonal/custom extensions, skins, whatever) and it failed, forcing me to do a complete rollback on the DB. You simply do not expect this kind of error when there is a "stable" version which - hopefully - has been tested (upgrade-wise).

88.130.119.59 (talkcontribs)

If this line was forgotten or somehow else put there, you can see in the Git repository. There you can check each single commit. I already did when the topic "wrong line" was brought up and the result is: The line was always there and has just been forgotten to be removed. There even was one last commit, which especially updated the README file; however: This line was forgotten.

As for your rollback problem it is hard to say what caused this without having more information and an exact error message. However, please put this to a different thread, should you still be in need of a solution for that!

KemikalElite (talkcontribs)

I've experiencing a similar error every time I attempt to upgrade even with older versions (1.20+).

Error: invalid magic word 'noglossary'

I disable all my extensions while upgrading (Removing the extensions from the LocalSettings.php and temporarily changing the extensions directory) then restore the extensions after the upgrade.

This may also help in your situation. It can be an annoying workaround and I'd be grateful if a better solution was found.

Ciencia Al Poder (talkcontribs)

This "solution" may not work, as some extensions may need to be included during the upgrade if they need to change things in the database.

88.130.119.59 (talkcontribs)

I know of extensions, which add/change stuff in the DB when they themselves are installed or updated. But I have never seen an extension change the DB when MediaWiki was updated. Do you have an example for that?

Ciencia Al Poder (talkcontribs)

You're supposed to update extensions at the same time you update MediaWiki, since they should match the MediaWiki release version, and when you upgrade such extensions (that have their own database objects) you should run update.php

88.130.119.59 (talkcontribs)

> when you upgrade such extensions (that have their own database objects) you should run update.php

When you update the extension; that's clear. Your first statement made it sound like you update MediaWiki and do not change anything with an extension and out of a sudden the extension wants to change the database. I do not know of any case, where that happens. Good that you clarified this.

120.147.16.155 (talkcontribs)

BUMP: So, forgetting about the RELEASE-NOTES detail, and given that the 1.22.0 download has not changed, what can I do to upgrade from 1.21.3 to 1.22.0 ? I get "Error: invalid magic word 'rootpagename'" after that upgrade.

120.147.16.155 (talkcontribs)

I just tried another upgrade from 1.20.6 to 1.22 and again got "Error: invalid magic word 'rootpagename'" there too. If others are not getting this error it must either be my environments which are all CentOS 6.5 x64 / MySQL 5.1.67 or 5.1.71 or something in my databases. I don't run extensions.

203.206.131.20 (talkcontribs)

I'm pretty sure it is a caching issue. If I build a fresh VM and restore the 1.21.3 DB and files, then perform the upgrade to 1.22 - it works. It is only on my "production" machines that I get "Error: invalid magic word 'rootpagename'" after performing the same upgrade. (Although dynamic, my home IP is 120.147.16.155 throughout this thread, but I'm at work now so I'll have a different IP.)

203.206.131.20 (talkcontribs)

So, I tried to fix it thusly :(

  1. php rebuildall.php
    • Rebuilding fulltext search index (if you abort this will break searching; run this script again to fix):

Dropping index... Rebuilding index fields for 2078 pages... 500 1000 1500 2000

Rebuild the index... Done.


    • Rebuilding recentchanges table:

Loading from page and revision tables... $wgRCMaxAge=7862400 (91 days) Updating links and size differences... Loading from user, page, and logging tables... Flagging bot account edits... Flagging auto-patrolled edits... Deleting feed timestamps. Done.


    • Rebuilding links tables -- this can take a long time. It should be safe to abort via ctrl+C if you get bored.

Refreshing redirects table. Starting from page_id 1 of 2078. 100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 Refreshing links tables. Starting from page_id 1 of 2078. "" is not a valid magic word for "rootpagename" [fcdec2da] [no req] Exception from line 316 of /var/www/html/mediawiki-1.22.0/includes/MagicWord.php: Error: invalid magic word 'rootpagename' Backtrace:

  1. 0 /var/www/html/mediawiki-1.22.0/includes/MagicWord.php(239): MagicWord->load(string)
  2. 1 /var/www/html/mediawiki-1.22.0/includes/parser/Parser.php(4982): MagicWord::get(string)
  3. 2 /var/www/html/mediawiki-1.22.0/includes/parser/CoreParserFunctions.php(91): Parser->setFunctionHook(string, array, integer)
  4. 3 /var/www/html/mediawiki-1.22.0/includes/parser/Parser.php(271): CoreParserFunctions::register(Parser)
  5. 4 /var/www/html/mediawiki-1.22.0/includes/parser/Parser.php(287): Parser->firstCallInit()
  6. 5 /var/www/html/mediawiki-1.22.0/includes/parser/Parser.php(4823): Parser->clearState()
  7. 6 /var/www/html/mediawiki-1.22.0/includes/parser/Parser.php(367): Parser->startParse(Title, ParserOptions, integer, boolean)
  8. 7 /var/www/html/mediawiki-1.22.0/includes/content/WikitextContent.php(300): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
  9. 8 /var/www/html/mediawiki-1.22.0/includes/content/AbstractContent.php(239): WikitextContent->getParserOutput(Title, NULL, NULL, boolean)
  10. 9 /var/www/html/mediawiki-1.22.0/maintenance/refreshLinks.php(244): AbstractContent->getSecondaryDataUpdates(Title)
  11. 10 /var/www/html/mediawiki-1.22.0/maintenance/refreshLinks.php(172): RefreshLinks::fixLinksFromArticle(integer)
  12. 11 /var/www/html/mediawiki-1.22.0/maintenance/refreshLinks.php(53): RefreshLinks->doRefreshLinks(integer, boolean, integer, integer, boolean, boolean)
  13. 12 /var/www/html/mediawiki-1.22.0/maintenance/rebuildall.php(58): RefreshLinks->execute()
  14. 13 /var/www/html/mediawiki-1.22.0/maintenance/doMaintenance.php(113): RebuildAll->execute()
  15. 14 /var/www/html/mediawiki-1.22.0/maintenance/rebuildall.php(65): require_once(string)
  16. 15 {main}
Reply to "MediaWiki 1.22 causes error: Invalid magic word "rootpagename""