"Internal error" code 131 when creating tweet with PNG images via REST API



This is from POST to https://api.twitter.com/1.1/statuses/update_with_media:
I get a lot of these errors when creating a tweet with a PNG that falls within the published limits:

{"errors":[{"message":"Internal error","code":131}]}

Here’s an example PNG that fails.
It is 1920x960 and total size is 2.42 MB, which is within Twitter’s documented limits.

These PNGs were working fine relatively recently, but we are seeing a lot of failures this week.
The relevant part of our code has not changed.

If I use a JPEG image instead, it works fine.


I don’t know of any changes to this endpoint and indeed cannot say why you’d suddenly see a change in behaviour. However, I’m sure you’re aware that update_with_media is deprecated.
Have you tried the newer upload process as well?


Thanks. No, I did not know it was deprecated.
We don’t generally change stable working code without good reason, but can give that a try.

More info if it helps: we send raw bytes (not base64 encoded).


Also @andypiper we have seen the same images fail when posting natively on twitter.com. Seems there is some problem with handling PNGs in general lately. This makes me very reluctant to try rewriting our code to use the newer API.


We have since switched to using 1.1/statuses/update.json and get the same error:

{"errors":[{"message":"Internal error","code":131}]}

I have many examples of PNGs that are within documented limits (well under 3 MB) but still cause this error.
Here’s a recent one: https://percolate.com/cdn/ugc/image/transcoded/9be598ee80fe7709c4fd7d53b5d8d99f_large.png

If I try the same image through the twitter UI, similar behavior occurs - the upload seems to succeed, but clicking “Tweet” causes an “Internal server error” dialog to pop up.


@andypiper any news here? We still see this failure. Here’s an image that triggers it: https://percolate.com/cdn/ugc/image/transcoded/9be598ee80fe7709c4fd7d53b5d8d99f_large.png


No news from my side, is this also related to the other thread you’ve been checking on?


I think it’s a different issue. The sample images that reliably caused “Media type unrecognized” now seem to work fine. But we are still getting these 131 errors on other images, eg. the one in my comment from yesterday. It fails with an error alert when added to a tweet natively via Twitter desktop web UI, too.


OK definitely seems like we need to clarify formats etc to work out what is happening with those images. Apologies that I hadn’t got to this sooner.


What’s the status of this issue? We do still occasionally see this error message. Here’s one from Mar 17 11:29:32.
This POST body was sent to https://api.twitter.com/1.1/statuses/update.json:


@slinkp23 Could you provide a link of source image? Some PNGs may fail due to timeout or other issues.


That may have been some other issue entirely, possibly transitory; the source appears to have been this JPEG:

And it appears to have only failed once and worked on a retry.

Not finding any other examples recently. I think we can close this bug :slight_smile:


Agree :slight_smile:

closed #14