I have a client for whom embedded youtube videos are missing. They appear in composer’s preview, but when the messages are saved, they disappear. They are working fine in try.discourse.org. I tried whitelisting youtu.be and changing the URL to a youtube.com url too. Neither solved the problem.
It seems that the problem was that recent Discourse updates have caused my DOI resolver plugin to muck things up. (I disabled a couple other things too, but it was definitely some plugin. . . )
Recently after a series of changes and upgrades to my Discourse Installation, only two things are missing. One is not being able to rebuild the data container, and I’m trying to figure it out, but the other is that every onebox works except with YouTube URLs.
From inside the server and container I can CURL to YouTube, how can I make sure that it is due to temporary IP Ban?
Edit: Can confirm that neither Rebuild (App) nor Rebake affect this issue.
Edit 2: By searching I saw that @jomaxro commented here that things like CloudFlare can affect Oneboxes… can a CDN affect just one Onebox? Tried putting it on Development Mode but no changes.
Edit 3: Tried removing all plugins. Nothing changed. (Also, I’m unable to rebake since it seems that processes cut each other).
Edit 4: Tried @Overgrow’s command and yep, indeed I have a problem
[1] pry(main)> posts = Post.where("raw like '%youtube%'").count
=> 72674
I’m having a hard time trying to run the rebake commands because my container is throwing me this:
First of all, thanks a million for taking time to help me @riking.
I ran that command and got what I assume is the number of posts missing: 22462. Based on the last part of the command, is safe to assume that it is running in the background?
Regex is not required to match a string in a post. A simple string search will match youtube (for example) well enough. In this example, every post with the string youtube in the post will be rebaked, one per every 100 seconds (very slow…)
I meant that I ran it on a small sample and then re-ran it but the number didn’t change.
ie: I ran the command and I had 76000 posts, it baked 200, then stopped and ran another and the new number was 76200 (yes, maybe my users added 400 posts with YouTube on it… but…I don’t know).
Now I’m running it again just to see how it goes but it will take some days (76500 hits…)
Since no one else has this issue I’m trying to think on my variables and basically:
Changed Machine (So it could be YouTube rate limiting?)
Restored a Discourse Backup on a new Install (this shouldn’t be related, but at this point I’m betting on everything that moves)
Two Container Installation (Thought I had an issue with the Data rebuild but thanks to this info from @Falco now I know that it is “normal”.
Put CloudFlare on top of it following the CDN Tutorials that are here.
Then I was like “well, doh, you need to add the timer, otherwise we can’t test the “Rate Limit Theory””, so I tried the one you posted:
root@cont-web-only:/var/www/discourse# time rake posts:rebake_match['youtube',string,100]
216 / 76594 (0.2%)-
And stopped it just to go check if things were changing. Apparently nothing, so I thought: “ok, let me run this again and see how it goes”:
root@cont-web-only:/var/www/discourse# time rake posts:rebake_match['youtube',string,100]
116 / 76598 (0.2%)-
That’s running right now. So my argument was that the number of total posts didn’t go down with the other rebake. (I could be, and possibly am, wrong with this logic).