Page MenuHomePhabricator

Beta Commons: Upload with File Caption tries 20 times(!) to get the entity ID to write, but fails
Closed, ResolvedPublic

Description

Upload with File Caption results in successful upload of file and creation of file page, but no caption (and an error message)

Steps to reproduce: Go to UploadWizard on Beta and attempt to upload an image with a File Caption. System hangs for >5 minutes, eventually shows an error (see attached image)

beta-upload-caption-bug.PNG (631×1 px, 198 KB)

Event Timeline

Ramsey-WMF moved this task from Untriaged to Next up on the Multimedia board.
Jdforrester-WMF renamed this task from Beta Commons - upload with File Caption doesn't quite work to Beta Commons: Upload with File Caption tries 20 times(!) to get the entity ID to write, but fails.Nov 6 2018, 5:50 PM

Looking at this now. Messy code.

Pageprops aren't being created, but… we don't need them?

Local fix to use M<pageid> just cascades to a different error:

Warning: [data-update-failed]: A data update callback triggered an exception (A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: SELECT  term_type,term_language,term_text,term_full_entity_id  FROM `wb_terms`    WHERE term_full_entity_id = 'M19'
Function: Wikibase\Lib\Store\Sql\TermSqlIndex::fetchTerms
Error: 1146 Table 'wiki.wb_terms' doesn't exist (127.0.0.1)

But I think that's just a local config issue.

Change 472039 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/UploadWizard@master] Captions: Instead of waiting for page_props to populate, use pageId

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

Change 472039 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@master] Captions: Instead of waiting for page_props to populate, use pageId

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

Uploads are working, future engineering work will be done on this but for now we're good.

Now that MediaInfo uses MCR, we probably shouldn't need page_props any longer.
We probably don't want to hardcode M<pageid> as a long-term solution, but it'll work for now.

Related (and I suspect this ticket can be merged in there): T205417: Is it still necessary to insert a row into page_props when creating a MediaInfo item for a page?