You are not wrong. You are just trying to solve a problem, perhaps frustrated your YT embeds are not working…
When you run this:
# time rake posts:rebake_match['youtube',string,100]
116 / 76598 (0.2%)-
Because the delay is set to 100, it will only rebake one post per 100 seconds. You have nearly 77K posts to rebake (using this pattern), so that would take about 90 days to rebake. When I used 100, it was only an example, not a recommendation, sorry to confuse you if I did
Even if you change it to a 10 second delay, your rebake will take about 9 days.
What rate do you want to actually rebake your “YT cakes”?
So, that 's a big clue; and now we know that even rebaking a single post with the rake task does not solve your issue (also confirmed that the HTML rebuild from the UI does not work as suggested by @Overgrow) , which is what you were trying to tell us before.
Thanks for the step-by-step troubleshooting.
Let me think about this for a while; and in the meantime, others might have some ideas now that the problem is becoming more clear.
Post one of your (not resolving) YT links (maybe where you added the ‘icemanworkingonthisheadache’ text) here and lets confirm one box works here (and I will also try on one of my staging sites).
One thing to try is to try signing into Google and visit the YouTube site while proxied through your server and see if it gives you any “interesting” error messages.
So, after a week of penitence, I made some progress but ultimately hit a wall.
All the details referred above are still in play.
After going above and beyond with debugging, turns out that the issue was the following: When I created the new Droplet I used the opportunity to update a few things I wasn’t able to do back then with the original one. One of those was IPv6. Turns out that Digital Ocean’s IPv6 Ranges are mostly banned by Google for some cosmic reason. So, word of advice to the future: If you are setting up a DO Discourse Installation, don’t set up IPv6, because you can’t remove that IPv6 later, you will have to change Droplet.
After correcting that, everything worked as expected. However, due to normal growth (and some recent tactics by Alphabet) I’m back to square zero because now I get this error and I don’t know of any way to “stop” Discourse from processing oneboxes (I even tried adding the YT domain to the Blacklist, with no success). This is because according to that post I linked “it should go away after an hour”, but I can’t freeze my rebakes… or can I? Should I? The other options rely on changing stuff on the server’s side but that would be… adding more IPs? Forcing “X-Forwarded-For” on Onebox calls?
Also, a bonus question: Why does Discourse “take the load” of calling YT? I mean, this error suggests that it is the Server’s IP that is being flagged as doing all the calls (yes, it is because of the onebox unfurl), but… why doesn’t that fall under the user loading the page? Performance?
As a kludge, I have tested this (not elegant) CSS (for you) and it seems to work to stop onebox (from processing); as a kind of “hit a fly with a hammer” approach, which you could turn on and off (add and subtract) until you come up with something better. Give it a try and see:
.onebox-body{
display:none;
}
Hope this helps.
Note:
I tested this on some onebox links and the onebox(es) disappeared and the link remained; but did not test in detail, sorry.
Just stop current processing. Do you know what triggered rebake that is running? Is it background job? If it is then just lower rebake old posts count setting to zero.
You can then use rebake of selected youtube posts (matching with regexp) with delays…
I can’t set it to zero, though. The UI says that the value should be between 1 and 2000000000. So I guess I will set it to 1 and combine it with your hack… that should allow me to see if the ban lifts.
(Because the other options are way heavier, being new IPs, LBs or directly forcing X-Forwarded-For on everything, and I don’t want to screw up how Discourse works )
Welp, no luck. Left it with value 1 and the hack to not display anything and the Ban is still up 5h later. Worst part? Obviously there is no way to contact them, so I’m just guessing ways to solve it.
You need to be patient. It may take up to 2-3 days before the ban is lifted in my experience. Just make sure there are no further requests to that IP…
You can check if there are still rebake jobs to run. Hint is in the code (this line selects posts that need rebaking in the background limited by rebake old posts count setting):