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

image
png

#1

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.
https://percolate.com/cdn/library/image/56038588_1920_1080
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.


#2

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?


#3

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).


#4

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.


#5

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.


#6

@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


#7

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


#8

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.


#9

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.


#10

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:
status=Artist+Ai+Weiwei+has+his+head+shaved+at+makeshift+refugee+camp+near+Idomeni+%40AFP+http%3A%2F%2Fgtty.im%2F1Z5dyaT&media_ids=710488223454105600


#11

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


#12

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:


#13

Agree :slight_smile:


#14