Intermittent 500 error when uploading tweets



Hi all,

I’m trying to investigate occasional 500 errors that I get from the API, when uploading a tweet with a single image, that’s been happening to me every now and then for a while.

Specifically, it occurs only for certain images - most images do not cause errors, but for those that do, I’ve noticed it tends to continually fail to submit said image. Today I ran into another instance of this, so thought I’d ask if others are getting similar issues on occasion.

The tweet I’ve been attempting to submit today, via the POST statuses/update endpoint, is thus:

You Rub Me the Right Way, by Artgerm:

(There’s an at symbol before Artgerm, but didn’t want to accidentally notify someone by mistake). One image, about 400KB and 1000x700 in size included with the status. I can upload the image here if that’ll help, or you can find it at the URL in the status text above.

Any ideas about what sorts of issues could cause this to occur would be greatly appreciated. :slight_smile:


Sounds really weird. Are you using the media/upload endpoint to upload the image successfully, and then having statuses/update fail? Or are you just posting a Tweet with a link, and having it not go through?

I was able to upload and Tweet the image using our large media upload sample.


Well, that’s bizarre… I went to try and re-test this with some more logging, and this time it succeeded in tweeting it. Odd, as the previous times I’ve tried to do this with various other images it would fail to post 5,6+ times at different times during the day before I’d give up attempting to tweet it.

I guess what I’ll do is wait and see if any more instances of this come up - I deleted some past tweets in my database since they weren’t working, so I don’t have any current images I know will trigger this issue to test with.

The code I was running up to now was calling both the media/upload endpoint and statuses/update endpoint in one try/catch block - I’ve split it up a bit so I can give some more concrete info if I find more cases of this :slight_smile:


OK thanks - good to hear it is working now, and I agree it sounds strange that it was failing like that before. If we are able to nail down any other commonalities then maybe we can figure it out further.


Yeah, I’ll wait until I run into this issue a few more times, then I can post some more specific information on different failure scenarios. The topic can sit here in the meantime :slight_smile: