Onebox is broken for some old links

(Hosein Naseri) #1

Onebox is getting broken for some old links. I’m pretty much sure the link isn’t broken. Because if I click edit button and without any edits, I post again, they become OK. Any Idea?

Streamable videos onebox are broken
(Jeff Atwood) #2

What do you mean? Can you provide examples?

(Hosein Naseri) #3

For example this post has a oneboxed url that is not showing anything.

you can see that the url is fine:

(Felix Freiberger) #4

What happens if you rebake the post? (In admin wrench, select Rebuild HTML.)

Are you certain that this link has been oneboxed previously in this post, i.e. the post randomly reverted to one without a link?

(Hosein Naseri) #5

I tested it and It got fixed.

Yes I’m absolutely sure. Because sometimes it happens for my own oneboxes. Its worth mentioning that only these kind of links which are shared videos from streamable are getting broken.

(Felix Freiberger) #6

That’s weird. Usually, as long as a post is not edited, it shouldn’t change at all – the HTML is baked and stored in the database.

I think there is a background task that slowly rebakes old posts over time. The only explanation I have is that either Streamable or your server had network issues or other problems when such a rebake occurred, so the URL failed to onebox then?

(Hosein Naseri) #7

You mean Its something in core discourse? Because I don’t have implemented such a background job.

It makes sense. Is there anything to rebake all post? Or even better, all posts that have these kind of links?

(Felix Freiberger) #8

Yes, that’s what I meant. And I remembered correctly, the feature is controlled by the rebake old posts count site setting :slight_smile:

Sure thing! You need console access to the server, however. This should do it:

cd /var/discourse
./launcher enter app
rake posts:rebake_match[""]

You can find details here:

(Hosein Naseri) #9

Why do we even need this? Is there any way to disable it? or making the interval longer than 15 mins?

(Felix Freiberger) #10

I’d think that setting the site setting to 0 would disable the feature, but I wouldn’t recommend doing that – it’s here for a reason, probably to ensure that updates to settings, the onebox engine or other features also affect old posts (over time) :slight_smile:

(Jacob Chapel) #11

This is not due to rebaking the HTML but streamable (for any cases it was a streamable link) blocking embeds of their videos directly.