Last modified: 2013-09-05 09:07:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53740, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51740 - TemplateData: page_props limits value length to 65535 bytes (MySQL 'blob' field)
TemplateData: page_props limits value length to 65535 bytes (MySQL 'blob' field)
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
TemplateData (Other open bugs)
master
All All
: High major with 1 vote (vote)
: ---
Assigned To: Bartosz Dziewoński
:
Depends on: 51888
Blocks: ve-nonenglish
  Show dependency treegraph
 
Reported: 2013-07-20 10:42 UTC by Bartosz Dziewoński
Modified: 2013-09-05 09:07 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bartosz Dziewoński 2013-07-20 10:42:17 UTC
TemplateData for [[pl:Template:Związek chemiczny infobox]] is not shown in VE. No idea why. The prop is visible on [[pl:Special:PagesWithProp]], so this must be a VE bug.
Comment 1 Bartosz Dziewoński 2013-07-20 14:38:11 UTC
*** Bug 51671 has been marked as a duplicate of this bug. ***
Comment 2 Bartosz Dziewoński 2013-07-20 14:39:33 UTC
Whoops, wrong bug, please disregard the comment above.
Comment 3 John Mark Vandenberg 2013-07-23 06:27:26 UTC
In the background is the following response from the server:

{"servedby":"mw1205","error":{"code":"templatedata-corrupt","info":"Page #837180 templatedata contains invalid data:Syntax error in JSON."}}

https://pl.wikipedia.org/w/api.php?format=jsonfm&action=templatedata&titles=Template:Zwi%C4%85zek_chemiczny_infobox

It is registered

https://pl.wikipedia.org/w/index.php?title=Specjalna:PagesWithProp/templatedata&limit=500&offset=0

This looks like the syntax error:

https://pl.wikipedia.org/w/index.php?title=Szablon:Zwi%C4%85zek_chemiczny_infobox/opis&diff=37123204&oldid=37115636

That diff needs to be approved, and check the update appears at:

https://pl.wikipedia.org/w/index.php?title=Specjalna:PagesWithProp/templatedata&limit=500&offset=0

(If that doesnt work, Maybe '?' is not allowed? *shrug*)
Comment 4 Bartosz Dziewoński 2013-07-23 09:51:12 UTC
Thanks John; I approved that revision, but it doesn't seem to have solved the issue :(
Comment 5 John Mark Vandenberg 2013-07-23 10:16:17 UTC
I notice that the PagesWithProps listing ends at:

je\u015bli podano warto\u015b\u0107 w parametrze \u201e3. napi\u0119cie powierzchniowe\u201d)."},"type"

Maybe the property has a buffer limit.

I have remove many parameters, and that appears to have fixed the problem
Comment 6 Bartosz Dziewoński 2013-07-23 11:53:41 UTC
http://www.sadtrombone.com/ …nice catch.

TemplateData is using the page_props table, whose pp_value field is a
'blob', which is limited to 65535 bytes [1]. Of course MySQL, being
MySQL, doesn't complain and just silently truncates the data on
insert.

I see three ways to do something about this:
* If over 65535 bytes, show a big fat red error to the user instead of
  silently failing.
* Store compressed data. JSON compresses well due to the redundancy in
  object keys and due to being mostly text in this case. This would
  probably raise the effective maximal length a few times and should
  be easy to implement.
* If over 65535 bytes, chunk the data in multiple properties
  'templatedata1', 'templatedata2' etc., with some marker stored in
  regular 'templatedata'. Handle this transparently in the API. Nasty,
  but would work.

Adjusting bug summary and component accordingly.

[1] https://www.mediawiki.org/wiki/Manual:Page_props_table
Comment 7 John Mark Vandenberg 2013-07-23 12:05:06 UTC
Option 4: store the JSON in a dedicated wikipage, and fiddle with TemplateData so it supports it.
Comment 8 Bartosz Dziewoński 2013-07-23 12:08:54 UTC
I chatted briefly with Krinkle and I'll try to implement solution #1 and #2.

I have no preference on #4, but it would be a large-ish architectural change now and would probably require migrating all of the templatedatas already added on wikis to the new format (or supporting both ways).
Comment 9 Helder 2013-07-23 12:12:54 UTC
(In reply to comment #7)
> Option 4: store the JSON in a dedicated wikipage, and fiddle with
> TemplateData so it supports it.

This is what I suggested on bug 50512 (to solve another problem).
Comment 10 Gerrit Notification Bot 2013-07-23 12:31:57 UTC
Change 75324 had a related patch set uploaded by Matmarex:
Bail when JSON length exceeds database limits

https://gerrit.wikimedia.org/r/75324
Comment 11 Gerrit Notification Bot 2013-07-23 13:33:54 UTC
Change 75330 had a related patch set uploaded by Matmarex:
Store compressed JSON since size is limited

https://gerrit.wikimedia.org/r/75330
Comment 12 Bartosz Dziewoński 2013-07-23 15:42:58 UTC
Core patch to avoid showing weird stuff: https://gerrit.wikimedia.org/r/75346
Comment 13 Bartosz Dziewoński 2013-07-23 16:13:33 UTC
I tested the patches above with [[pl:Template:Związek chemiczny infobox]]: size of raw processed JSON is ~112 kB, size of compressed JSON is ~7.5 kB. Looks good enough for practical use.
Comment 14 Gerrit Notification Bot 2013-08-01 21:41:41 UTC
Change 75324 merged by jenkins-bot:
Bail when JSON length exceeds database limits

https://gerrit.wikimedia.org/r/75324
Comment 15 Richard Morris 2013-08-28 11:25:04 UTC
This problem can occur with templates with a large number of numbered fields
Just a raw skeleton without descriptions for http://en.wikipedia.org/wiki/Template:Infobox_officeholder 
take 174,407 bytes, as it has very many numbered fields vicepresident2 ... vicepresident14 etc. Fixing bug 52582 allowing autonumbered parameters might solve problems when this occurs.
Comment 16 Gerrit Notification Bot 2013-09-05 09:07:49 UTC
Change 75330 merged by jenkins-bot:
Store compressed JSON since size is limited

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links