Page MenuHomePhabricator

https://wikimedia.org/api/rest_v1/#!/Transform/post_transform_html_from_from_lang_to_to_lang_provider doesn't return any content
Closed, ResolvedPublic

Description

Note that we have have two endpoints: mt and translate. Or actually three is we count the central location as well (https://wikimedia.org/api/rest_v1/transform/html/from/en/to/ca/Apertium), but it does the same thing as the mt endpoint). The translate endpoint has a different issue documented in T173038: /v1/translate/{from}/{to}{/provider} endpoint fails while deploying cxserver.

Neither the mt or the central equivalent currently works. It always returns HTTP 200 with empty (just <div></div>) as a result.

These don't work (en -> ca using Apertium):

This works:


Why is it returning HTTP 200 code even though a some kind of error happens?

My best guess currently is that restbase is not sending the body as application/x-www-form-urlencoded but instead as multipart/form-data or something else. I was not able to figure out what the HyperSwitch library uses internally and how it handles post requests.

Where is get_from_cx defined? It's used in https://github.com/wikimedia/restbase/blob/master/v1/transform-global.yaml#L60 Also, why is https://github.com/wikimedia/restbase/blob/master/v1/transform-lang.yaml#L54 using operationId: doMT instead? Shouldn't those two be the same?

Event Timeline

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

I created a pull request for this fixing this issue: https://github.com/wikimedia/restbase/pull/855

This is now merged. Pending deployment

This has been deployed, please verify that it works.

Arrbee triaged this task as Medium priority.

Response is:

{
  "type": "https://mediawiki.org/wiki/HyperSwitch/errors/internal_http_error",
  "method": "post",
  "detail": "Error: ESOCKETTIMEDOUT",
  "uri": "http://cxserver.discovery.wmnet:8080/v1/mt/en/es/Apertium"
}

Response is:

{
  "type": "https://mediawiki.org/wiki/HyperSwitch/errors/internal_http_error",
  "method": "post",
  "detail": "Error: ESOCKETTIMEDOUT",
  "uri": "http://cxserver.discovery.wmnet:8080/v1/mt/en/es/Apertium"
}

This could mean that Restbase is not properly forwarding the payload. Symptom at least seems to be the same what I observed in https://gerrit.wikimedia.org/r/#/c/389481/

I've setup restbase locally and doing same for Labs to reproduce this again.

Change 394975 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Throw error if content to translate is not provided or empty

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

mobrovac subscribed.

Eh, such an obvious mistake. Thank you for hunting this down @santhosh ! Should be deployed in the next couple of days.

Change 394975 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Throw error if content to translate is not provided or empty

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

Stashbot subscribed.

Mentioned in SAL (#wikimedia-operations) [2017-12-06T10:39:41Z] <mobrovac@tin> Started deploy [restbase/deploy@b1d7c82]: Use Cass3 for revisions, deprecate trending-edits, fix CX end point - T179421 T180384 T173801

Mentioned in SAL (#wikimedia-operations) [2017-12-06T10:45:43Z] <mobrovac@tin> Finished deploy [restbase/deploy@b1d7c82]: Use Cass3 for revisions, deprecate trending-edits, fix CX end point - T179421 T180384 T173801 (duration: 06m 02s)

Deployed, verified it works. Resolving.