Page MenuHomePhabricator

templatedata contains invalid data: Property \"templatedata\" is expected to be of type \"object\"
Closed, ResolvedPublic

Description

On installing and activating TemplateData on my wiki I recieve the following error when attempting to access template data via the API:

{
    "error": {
        "code": "templatedata-corrupt",
        "info": "Page #27861 templatedata contains invalid data: Property \"templatedata\" is expected to be of type \"object\".",
        "*": "See https://www.dragon-mania-legends.wiki/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    }
}

Source: https://www.dragon-mania-legends.wiki/api.php?action=templatedata&titles=Template:Ae&format=jsonfm
Template: https://www.dragon-mania-legends.wiki/index.php?title=Template:Ae
Template doc page with the TemplateData: https://www.dragon-mania-legends.wiki/index.php?title=Template:Ae/doc

In the template documentation page is the following:

<templatedata>
{
	"description": "Test Template",
	"params": {
		"1": {
			"label": "This is an item",
			"description": "This is a description",
			"example": "This is an example",
			"type": "string",
			"required": true
		}
	}
}
</templatedata>

Template Data is installed, the correct version for MW 1.33. (I also have the version for MW 1.34 installed on a test server, with the correct version for 1.34, same host, same error, so reproducible (at least on my server it is)). There are no errors in Chrome console, the job queue is empty. I have no idea what to do about it. My versioning is as follows:

MW 1.33, site:
Product Version
MediaWiki 1.33.0 (62dc614)
06:13, 24 July 2019
PHP 7.3.15 (cgi-fcgi)
MySQL 5.7.28-log
ICU 57.1
Template data on the 1.33.0 site:
TemplateData: REL1_33
2020-05-25T18:46:03
7ffe97a

MW 1.34, site:
Product Version
MediaWiki 1.34.2
PHP 7.3.15 (cgi-fcgi)
MySQL 5.7.28-log
ICU 57.1
Template data on the 1.34.2 site:
TemplateData: REL1_34
2020-05-25T18:46:03
b9ccaf6

Article path /$1
Script path /
index.php /index.php
api.php /api.php
load.php /load.php

  • Job queue is empty
  • Api works for other purposes so the endpoint is correct
  • A Google search on this turns up nothing helpful

Any idea what the issue could be? Is it a bug?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I'm not sure how to close this, I've come to the conclusion that it's our Database.

Once upon a time apparently (was before my time) a bureaucrat tried to upgrade the site, likely without creating a db backup, borked it, then had someone repair it. Ever since it has been one strange issue after the other...

I tried a clean install same version same extensions, skin, works fine. Import the database, it's broken. Delete all gadgets, widgets or any kind of scripted add-on, it's still broken. Import the pages into a clean database, it works. Hence, I'm pretty sure it's our database.

TiltedCerebellum triaged this task as Lowest priority.