Page MenuHomePhabricator

Wrong geoJSON error message if <mapframe> tag ist used with external data from Wikimedia Commons
Open, Needs TriagePublicBUG REPORT

Description

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

  • Use any Wikivoyage page, for instance at de.wikivoyage.org or en.wikivoyage.org
  • Enter the following code at any page, for instance at your user page:
<mapframe width="300" height="400">
{
  "type": "ExternalData",
  "service": "page",
  "title": "Neighbourhoods/New York City.map"
}
</mapframe>

This code is an example code from https://www.mediawiki.org/wiki/Help:Extension:Kartographer. The map named is existent on Wikimedia Commons.

What happens?:
Since one/few days an error message is shown: "mapframe: Der Titel „Neighbourhoods/New York City.map“ ist keine gültige Kartendatenseite" ("The title 'Neighbourhoods/New York City.map' is no valid map-data page."). And no map is shown. The external date are are missing in the wgKartographerLiveData, too. The error message seems to be the same independent of the use of the parser (Legacy, Parsoid).

What should have happened instead?:
Because there is no wrong map-data page the error message should not occur like in the last years, and the map should be shown.

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

Other information (browser name/version, screenshots, etc.):

Event Timeline

See also "Category:Pages with broken maps" (de: "Kategorie:Seiten mit defekten Karten")

This appears to be due to a recent code deployment. It was not happening yesterday. See https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=1365746588#%22not_a_valid_map_data_page%22 for some links.

The English-language error message is "mapframe: Title "Robben Island Marine Protected Area.map" is not a valid map data page" (varies based on the map name).

Also, when the display=title option is used in Template:maplink, a Linter "div-span-flip" https://en.wikipedia.org/wiki/Special:LintErrors/misc-tidy-replacement-issues error is caused, possibly because the MediaWiki error message is wrapped in div tags, but Template:maplink wraps its output in span tags (just a guess here).

Same problem is present since very recently in svwiki.

Adding Content-Platform-Team, as I cannot find a project hashtag for the Content-Transform-Team listed on https://www.mediawiki.org/wiki/Developers/Maintainers for Kartographer. At least the Phab link on https://www.mediawiki.org/wiki/Content_Transform_Team redirects to Content-Platform-Team...

Yes, it is related. The code is comparing class names from config against the code. The config wgJsonConfigModels is still using the old names.

$wgJsonConfigModels['Tabular.JsonConfig'] = 'JsonConfig\JCTabularContent';
[...]
$wgJsonConfigModels['Map.JsonConfig'] = 'JsonConfig\JCMapDataContent';

Adding them back to the code

Change #1316026 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Kartographer@master] Support older config values in $wgJsonConfigModels

https://gerrit.wikimedia.org/r/1316026

https://en.wikipedia.org/wiki/Category:Pages_with_broken_maps has expanded to 6,764 pages as of this writing. Red error messages are displaying instead of maps.

Once this is fixed, some post-bug-fix situation analysis would be helpful to understand why this bug that affected so many Wikipedia articles across many languages (1 out of every 1,000 articles on the English Wikipedia) was allowed to go into production and remain in production for multiple days.

Also, FWIW, at least on my display, the red error message (#BE3C2C) displayed on a light-red background (#FFE9E5) has a contrast ratio of 4.65:1, which fails the WCAG AAA contrast accessibility test.

.nhals8 subscribed.

Same problem in viwiki

Change #1316026 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Support older config values in $wgJsonConfigModels

https://gerrit.wikimedia.org/r/1316026

Hi, I noticed it also happened in a spanish wiki (see here), but not in another one (see here)

... Red error messages are displaying instead of maps.
...
Also, FWIW, at least on my display, the red error message (#BE3C2C) displayed on a light-red background (#FFE9E5) has a contrast ratio of 4.65:1, which fails the WCAG AAA contrast accessibility test.

WCAG 2 Level AAA is a nice-to-have, it's not essential. Think of it as a "MAY" as described by RFC 2119; by the same comparison, a "SHOULD" would be Level AA Compliance, i.e. contrast ratio 4.5:1, which this satisfies.

The same embedded map from WikiMedia is embedding without error on my user profile User:Smithr32 but not on the desired article - both are En pages.

Sounds quite close to "Unbreak Now" to me.

Aklapper triaged this task as Unbreak Now! priority.Tue, Jul 28, 10:40 AM

I have created https://en.wikipedia.org/wiki/MediaWiki:Kartographer-error-title with: 'A bug prevents map display. A fix is underway. '
enwiki now displays this instead of the misleading default message: 'Title "$1" is not a valid map data page'
See for example the new message in the infobox in https://en.wikipedia.org/wiki/Robben_Island_Marine_Protected_Area?uselang=en
Same page with German interface: https://en.wikipedia.org/wiki/Robben_Island_Marine_Protected_Area?uselang=de
The message can be deleted after the bug fix is deployed and has propagated to the affected articles.

Change #1318753 had a related patch set uploaded (by Arlolra; author: Umherirrender):

[mediawiki/extensions/Kartographer@wmf/1.47.0-wmf.12] Support older config values in $wgJsonConfigModels

https://gerrit.wikimedia.org/r/1318753

Change #1318753 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@wmf/1.47.0-wmf.12] Support older config values in $wgJsonConfigModels

https://gerrit.wikimedia.org/r/1318753

Mentioned in SAL (#wikimedia-operations) [2026-07-28T20:27:33Z] <arlolra@deploy1003> Started scap sync-world: Backport for [[gerrit:1318753|Support older config values in $wgJsonConfigModels (T433008)]]

Mentioned in SAL (#wikimedia-operations) [2026-07-28T20:29:32Z] <arlolra@deploy1003> arlolra: Backport for [[gerrit:1318753|Support older config values in $wgJsonConfigModels (T433008)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-07-28T20:34:28Z] <arlolra@deploy1003> Finished scap sync-world: Backport for [[gerrit:1318753|Support older config values in $wgJsonConfigModels (T433008)]] (duration: 06m 54s)

Please confirm that this is fixed and resolve the task when there's consensus

It appears to be fixed on the English Wikipedia. I am null-editing the "broken maps" category members now to see if there are remaining errors; it will take an hour or two.

It is still broken at https://es.wikipedia.org/wiki/Metrob%C3%BAs_de_la_Ciudad_de_M%C3%A9xico#L%C3%ADneas even after a null edit.

There are a few articles left in the "broken maps" category after null edits, such as https://en.wikipedia.org/wiki/Alfred_the_Great#Death_and_burial and https://en.wikipedia.org/wiki/Boeotia#Boeotian_League

The error in the article doesn't display properly and is something like "maplink: Couldn't parse JSON: Control character error, possibly incorrectly encode ..." I don't see any errors in the template, so I can't tell if the error is related to this bug or some other cause.

They seem unrelated. At least the second one, the issue appears to be use of {{frac|...}} in the labels

https://en.wikipedia.org/wiki/Alfred_the_Great#Death_and_burial has an error caused by <ref> in a parameter.
https://en.wikipedia.org/wiki/Boeotia#Boeotian_League has an error caused by {{frac}} in parameters.
Both are a different error message from the bug and unrelated.

I have checked all articles in https://en.wikipedia.org/wiki/Category:Pages_with_broken_maps with the error message from the bug - which is currently 'A bug prevents map display. A fix is underway. ' as set by https://en.wikipedia.org/wiki/MediaWiki:Kartographer-error-title. They were all fixed by a purge. None of them were fixed by a null edit or multiple null edits. That's the first time in my 20 Wikipedia years I have encountered an issue which can be fixed by a purge but NOT by a null edit. Maybe Firefox displayed a browser-cached version after the null edits but that doesn't usually happen for me. I have run out of examples to test.

I think this bug has been fixed. Please follow up with an after-action report to understand how this bug was allowed to be in production for almost a week, affecting thousands of articles across multiple Wikipedias. It would be great to avoid this sort of thing happening in production again.

It's rather simple: Instead of using proper instanceof checks, which would have worked with no problem, some critical code in the JsonConfig codebase forces users to compare full qualified class names as strings. The class name changed 5 months ago and an alias was left behind. Later some code started using the new class name, but other code continued to use the old alias.

The original mistake that made us run into this situation happened in 2014, see https://gerrit.wikimedia.org/r/161893.

ssastry lowered the priority of this task from Unbreak Now! to Needs Triage.Wed, Jul 29, 4:29 PM
ssastry subscribed.

You wouldn't know this since we didn't make a note of it when we triaged it, but we left it in the Verify column so that we can go through this task and file some followup tasks. So, reopening it for that reason.

Umherirrender unsubscribed.

The tracking category "Category:Pages_with_broken_maps" for all wikis contains more errors as only this one, so it can be remain filled due to possible other issues, but it should be on the same count as before this task.

For Kartographer code base:
Feature was added in f3f7239a6a7c87e44bd299d0e41eedc8eba6e94b and compares the class string with the config.
The change of the class alias in f3f7239a6a7c87e44bd299d0e41eedc8eba6e94b broke this compare.

For JsonConfig code base:
The change linked by Thiemo does not add compare of class strings, it is using the class name from the config to instance the class, that works with aliases, but can broke as well when the alias get removed. But showing up in the error log as a fatal error instead of the parsing error in this task - see https://gerrit.wikimedia.org/r/c/mediawiki/extensions/JsonConfig/+/1312257 for the remove of alias, with mapping of config.

Hi all - seems to be a follow on issue with interactive maps using external data/data namespace - the map png thumbnail appears instead of the scalable map when the expand icon/thumbnail is clicked.
Turning off Media Viewer in WP preferences (as stated here) fixes this
Tried a purge and null edit at these to no avail
https://en.wikipedia.org/wiki/Navajo_Nation
https://commons.wikimedia.org/wiki/Data:Sandbox/TheEqualizer/Example4.map
Issues reported at Wiki:
https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Maplink_with_thumbnail_error
https://en.wikipedia.org/wiki/Module_talk:Mapframe#clicking_on_maps_now_opens_up_a_PNG?

Hi all - seems to be a follow on issue with interactive maps using external data/data namespace - the map png thumbnail appears instead of the scalable map when the expand icon/thumbnail is clicked.

It's a separate issue. See T433703: Interactive map fails to load

Hi all - seems to be a follow on issue with interactive maps using external data/data namespace - the map png thumbnail appears instead of the scalable map when the expand icon/thumbnail is clicked.

It's a separate issue. See T433703: Interactive map fails to load

I did a search, honest. But thanks