Page MenuHomePhabricator

MWException: Format text/x-wiki is not supported for content model javascript
Open, Needs TriagePublicPRODUCTION ERROR

Description

Steps to replicate the issue (include links if applicable):

What happens?:
Internal error:

[{reqId}] {exception_url} MediaWiki\Exception\MWException: Format text/x-wiki is not supported for content model javascript

Backtrace:

from /srv/mediawiki/php-1.44.0-wmf.24/includes/content/ContentHandler.php(513)
#0 /srv/mediawiki/php-1.44.0-wmf.24/includes/content/TextContentHandler.php(55): MediaWiki\Content\ContentHandler->checkFormat(string)
#1 /srv/mediawiki/php-1.44.0-wmf.24/includes/content/AbstractContent.php(147): MediaWiki\Content\TextContentHandler->serializeContent(MediaWiki\Content\JavaScriptContent, string)
#2 /srv/mediawiki/php-1.44.0-wmf.24/includes/editpage/EditPage.php(2990): MediaWiki\Content\AbstractContent->serialize(string)
#3 /srv/mediawiki/php-1.44.0-wmf.24/includes/editpage/EditPage.php(1411): MediaWiki\EditPage\EditPage->toEditText(MediaWiki\Content\JavaScriptContent)
#4 /srv/mediawiki/php-1.44.0-wmf.24/includes/editpage/EditPage.php(749): MediaWiki\EditPage\EditPage->initialiseForm()
#5 /srv/mediawiki/php-1.44.0-wmf.24/includes/actions/EditAction.php(68): MediaWiki\EditPage\EditPage->edit()
#6 /srv/mediawiki/php-1.44.0-wmf.24/includes/actions/ActionEntryPoint.php(728): MediaWiki\Actions\EditAction->show()
#7 /srv/mediawiki/php-1.44.0-wmf.24/includes/actions/ActionEntryPoint.php(505): MediaWiki\Actions\ActionEntryPoint->performAction(MediaWiki\Page\Article, MediaWiki\Title\Title)
#8 /srv/mediawiki/php-1.44.0-wmf.24/includes/actions/ActionEntryPoint.php(143): MediaWiki\Actions\ActionEntryPoint->performRequest()
#9 /srv/mediawiki/php-1.44.0-wmf.24/includes/MediaWikiEntryPoint.php(202): MediaWiki\Actions\ActionEntryPoint->execute()
#10 /srv/mediawiki/php-1.44.0-wmf.24/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}

What should have happened instead?:
Just reports "Content format not supported"

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
Related issues: https://phabricator.wikimedia.org/T347073

Event Timeline

Restricted Application changed the subtype of this task from "Bug Report" to "Production Error". · View Herald TranscriptApr 9 2025, 8:29 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Thanks for reporting this! Cannot reproduce.

Thanks for reporting this! Cannot reproduce.

Try to manually add URL query parameter when editing "common.js": "?action=edit&model=wikitext&format=text/x-wiki"

Try to manually add URL query parameter

Hmm, why would you do that?

Try to manually add URL query parameter

Hmm, why would you do that?

I have a similar issue on my wiki which runs MediaWiki 1.43 when trying to create a JSON model page in the main namespace whose default model is wiktext; sometimes it throws an internal error like that, and sometimes it responds with an empty page with HTTP 500 status code.

I think manually adding URL query parameters is required because Special:MyPage removes model=wikitext&format=text/x-wiki parameters when redirecting to the viewer's common.js page. This error happens when editing a page with a non-default content model, such as editing the user's common.js page as a wikitext page.

The author thought it should just reported "Content format not supported" instead, but I think it should be noted that even though the model=wikitext parameter is given, the parameter is not recognized and the error message text/x-wiki is not supported for content model javascript is displayed.

This comment was removed by Gustmd7410.