And then move it to a new IP address every time it gets rate-limited.
depending on imgurs ratelimits and that sites usage of it, you could toggle between proxy and non proxy
Hi Jay, I have disabled downloading all hotlinked images, because my forum has tons of them and I don’t want to deal with all the storage space.
It still seems to me that Discourse shouldn’t fail to generate
<img> tags just because the link throws a 429 error. It’s treating it as if it were a 404 link, whereas a 429 by definition means that it’s a working link. If the link ends in
.png or whatever and it’s not a 404 then it should wrap it in
<img> tags and be done with it. It would even show up correctly in the post preview that way.
Then it shouldn’t be trying to access them, i would think. What settings did you change?
download remote images to local is disabled.
Had it always been set? What if you rebuild html on the posts that have the imgur images?
Oh! And it’s discourse that’s getting the error and not your local browser?
It happens as early as in the post editor, when pasting an Imgur link it tries to create a Onebox in the post preview but fails with a oneboxed 429 error that Discourse injects into the post preview.
As I understand it, my Discourse server first tries to validate the naked image URL and hits Imgur, which in turn eventually rejected my server’s domain / IP because of many requests. Then Discourse fails to wrap the URL in
<img> tags because it couldn’t validate the image, and it just leaves the naked URL in the post.
As of now the problem seems to have resolved on my server, i.e. Imgur has removed the rate limit, for now. I’m sure it won’t be the last time though, so this issue remains.
Ah! I see. Then I think you need a plugin, or maybe a theme component that will handle those images without sending the request.
hello, I’m using google translate to understand the conversation, but it wasn’t clear to me (maybe it’s a translation without literal meaning) How did you solve the problem?
There is no solution yet. Imgur blocks Discourse from displaying the image preview, and Discourse does not properly handle that error and fails to create the proper HTML to display the image.
As a workaround:
What language is your native language so I can translate that part of the conversation?
i’m not clear why you are implying Discourse is responsible for handling an error because Imgur is blocking images. this is an Imgur thing, not a discourse functional weakness or bug. it sounds like you may need a plug-in built to handle this if you need to have imgur photos.
Discourse should still generate valid HTML to display the image. Imgur throws a 429 error when the Discourse server tries to pull a preview of the image link, but Discourse treats it as if it were a 404 error. On my forum this image is not displayed with just the URL:
But the following HTML works to display the image:
That is what Discourse should generate for the baked post even if it receives a 429 when the server hits the URL, and it should only leave the naked URL if it gets a 404 error.
This problem is still continuing to affect my Discourse forum.
@community-moderators Would it be possible to move this to bug , or copy the last post into a new topic? (Of course I can do that myself too if you think that’s best.)
That suggests that your server has been rate limited and can’t get images from imgur. Links to the images worry because they are retrieved by the user and not your server.
The server is indeed getting rate limited when it tests the Imgur link and tries to Onebox it. But there’s nothing preventing individual users from viewing it when the link is properly wrapped in
<img> tags. The problem is that Discourse is assuming that the link is not a viewable image for all users when in reality it’s only a problem for the server, and it’s just wrapping the Imgur URL in in
I’m not sure it classifies as a bug though I understand the annoyance
If you have figured out that this is indeed the issue, I invite you to post a new topic with a proper description of the issue in feature and see how it goes
Thanks @Canapin .
digging out this one
We have the same issue with Imgur, embed not working.
In the composer preview, following error message appears:
Sorry, we were unable to generate a preview for this web page, because the web server returned an error code of 429. Instead of a preview, only a link will appear in your post.
example link: How To: Quickstop - FAQs & How-tos - pev.dev (scroll to bottom of first post)
Your post seemed to fit better in this topic, so I’ve moved it across.