Imgur images not rendering because server is rate limited

I have added a post via the API. It contains the following snippet:

![Here is an example](https://i.imgur.com/LaUXRKW.png)

As visible here, it is correctly rendered in the editor:

Initially after saving, it is correctly shown in the topic too. However, after reloading the website it is rendered like this:
image

What I already tried:

  • check that the raw content in the database is correct
  • from the web interface, select “Rebuild HTML”
  • from the server console, perform rake posts:rebake (no errors)
  • disabled browser cache to ensure I don’t see an old render
  • restarted the app via ./launcher restart app
  • restarted the whole server

I don’t know what else to do at this point. Any tips on how to debug this further?

This is a fresh standard install using docker. I am on version 3.2.0.beta4-dev

To clarify, does it still happen if you create the message manually?

Also, this is a random idea, but did you try inserting a new line above to see if the image will appear?

On my side, I tried using the API or doing it manually, and I could not reproduce it. :thinking:.

I’m not familiar with that format to add image links, but I wondered if the issue could be connected to the block hotlinked media setting?

Thanks for the idea, but this setting is not enabled on my instance.

1 Like

Your server has been rate limited by imgur. You can read the image with your browser, but not download it from your server.

If you try to pull the image from your server with curl or wget, you’ll get an error.

3 Likes

Just tested this, and yes it does happen there too. So it does not seem to be related to the API (I’ll adjust the topic title).

No difference, this still happens. As for reproduction, I am able to reproduce this reliably using this as the full topic content:

Test
![some alt text](https://i.imgur.com/LaUXRKW.png)

Oof, I see. This makes sense since before I ran into this, I did import 120k topics. So that must have fetched a lot of images from imgur.
Thanks for pointing this out, I simply thought the client does all image requests!

I find it interesting that the server does these requests, I assume it is to cache them locally in case the original disappears? I will look for ways to spread the process out a bit, so that the 120k posts get build over a longer period of time to prevent the server from being blacklisted or rate limited. I mean for this server it’s not a problem, it’s just on integration. But once I do the import on prod I’d like to prevent this :sweat_smile:

Continued as a new question: How to spread out import over longer timer to prevent running into rate limits of external services

1 Like

Right.

Unless you turn off the settings that enable this behavior.

So do the import on another machine and restore the backup to prod. A more complicated solution would be to contrive to have your server retrieve stuff via a proxy server.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.