Page MenuHomePhabricator

Wikidata mobileapps endpoints (summary/mobile-sections) throw 500
Closed, ResolvedPublic

Description

Per IRC locally when trying to access mobile-sections and summaries via wikidata.org a 500 is thrown. This does not appear to be enabled in production, so is not a big deal, but for completeness we should probably prevent these from 500ing even locally.

IRC conversation for prosperity:

jdlrobson> mdholloway: that said.. it shouldnt throw a 500 error :) http://0.0.0.0:6927/wikidata.org/v1/page/summary/Q1
1:34 PM "Cannot read property 'general' of undefined"
1:34 PM http://0.0.0.0:6927/wikidata.org/v1/page/mobile-sections/Q1
1:35 PM (we should disable for that host right?!)
1:35 PM mdholloway: should i raise a bug?
1:35 PM 
<mdholloway> Michael Holloway jdlrobson: please do!
1:35 PM thanks for catching that...
1:35 PM 
<jdlrobson> Jon Robson mdholloway: actually.. maybe it's fixed further up ? https://wikidata.org/api/rest_v1/page/mobile-sections/Q1
1:35 PM says that endoint is not available..
1:35 PM likewise: https://wikidata.org/api/rest_v1/page/summary

Event Timeline

Change 397702 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/services/mobileapps@master] Correct API url for queries to Wikidata api

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

Change 397702 abandoned by Jdlrobson:
Correct API url for queries to Wikidata api

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

Ignore me.
Looks like the domain I was using is wrong.
http://0.0.0.0:6927/www.wikidata.org/v1/page/summary/Q1 works fine. (204)

Not sure if we need to do any handling to check the domain is valid?
If not, feel free to decline.

We should probably be correctly handling the top-level wikidata.org domain.

@bearND I believe that's correct. Per a IRC convo with @Jdlrobson earlier Reading Web isn't using them, and I can't imagine the apps having a use for Wikidata summaries.

Yup, this bug is more about making the code readable and not 500 for when we do decide to do that :)

@Jdlrobson @bearND can we clarify if work is needed here? And if so which team?

bearND claimed this task.

I think we can close this with the caveat that www.wikidata.org has to be used instead of just wikidata.org.
Not sure when the fix was made but curl -sI "http://0.0.0.0:6927/www.wikidata.org/v1/page/summary/Q1" returns status 200 with type: no-extract now.