Twitter Video Finalize results in an HTTP 500 - Code 131

android
fabric
api

#1

Hello,

I am attempting to post a properly formatted video to Twitter using the multi-part chunked upload API call.
So far I am able to:
INIT - Returns: {“media_id”:639548352791580673,“media_id_string”:“639548352791580673”,“expires_after_secs”:86399}
APPEND chunks 0 and 1 - Returns: HTTP 204 for both chunks
However, FINALIZE Returns the following:

    D/Retrofit﹕ ---> HTTP POST https://upload.twitter.com/1.1/media/upload.json
    D/Retrofit﹕ Authorization: OAuth oauth_callback="", oauth_consumer_key="<Removed>", oauth_nonce="7124904635097685440470180875700090", oauth_signature="<removed>", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1441315211", oauth_token="<removed>", oauth_version="1.0"
    D/Retrofit﹕ Content-Type: application/x-www-form-urlencoded; charset=UTF-8
    D/Retrofit﹕ Content-Length: 44
    D/Retrofit﹕ command=FINALIZE&media_id=639548352791580673
    D/Retrofit﹕ ---> END HTTP (44-byte body)
    D/Retrofit﹕ <--- HTTP 500 https://upload.twitter.com/1.1/media/upload.json (162ms)
    D/Retrofit﹕ : HTTP/1.1 500 Internal Server Error
    D/Retrofit﹕ cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
    D/Retrofit﹕ content-disposition: attachment; filename=json.json
    D/Retrofit﹕ content-type: application/json;charset=utf-8
    D/Retrofit﹕ date: Thu, 03 Sep 2015 21:20:11 GMT
    D/Retrofit﹕ expires: Tue, 31 Mar 1981 05:00:00 GMT
    D/Retrofit﹕ last-modified: Thu, 03 Sep 2015 21:20:11 GMT
    D/Retrofit﹕ pragma: no-cache
    D/Retrofit﹕ server: tsa_a
    D/Retrofit﹕ set-cookie: lang=en; Path=/
    D/Retrofit﹕ set-cookie: guest_id=v1%3A144131521187101575; Domain=.twitter.com; Path=/; Expires=Sat, 02-Sep-2017 21:20:11 UTC
    D/Retrofit﹕ status: 500 Internal Server Error
    D/Retrofit﹕ strict-transport-security: max-age=631138519
    D/Retrofit﹕ vary: Origin
    D/Retrofit﹕ x-access-level: read-write
    D/Retrofit﹕ X-Android-Received-Millis: 1441315211552
    D/Retrofit﹕ X-Android-Response-Source: NETWORK 500
    D/Retrofit﹕ X-Android-Sent-Millis: 1441315211406
    D/Retrofit﹕ x-connection-hash: 011dc8046e8b036da135234d35ca64e5
    D/Retrofit﹕ x-frame-options: SAMEORIGIN
    D/Retrofit﹕ x-rate-limit-limit: 615
    D/Retrofit﹕ x-rate-limit-remaining: 613
    D/Retrofit﹕ x-rate-limit-reset: 1441318791
    D/Retrofit﹕ x-response-time: 30
    D/Retrofit﹕ x-transaction: e9a196090ba37539
    D/Retrofit﹕ x-tsa-request-body-time: 0
    D/Retrofit﹕ x-twitter-response-tags: BouncerCompliant
    D/Retrofit﹕ x-xss-protection: 1; mode=block
    D/Retrofit﹕ {"errors":[{"message":"Internal error","code":131}]}
    D/Retrofit﹕ <--- END HTTP (52-byte body)

Please note that I’ve removed my key, signature, and oauth token for security reasons. Assume that POST contains the key, signature, and token.

Any ideas or feedback will be greatly appreciated. I’ve been trying to get this to work for a week or so and this is the closest that I’ve come to getting this to work properly.

Thanks Again,

Rob


Custom Video API Call Returns 404 on Init
#2

I’m getting the same error in the same situation.

Have you had any luck with diagnosis?


#3

issue in my case was that I was reading and APPENDing a local file while it was still being written. FINALIZE threw an error 'cuz the uploaded file wasn’t complete.