Discourse embed: inconsistent errors


(Marcia Ramos) #1

We’re trying to implement Discourse embed comments to our documentation website, and we’re facing an inconsistent error with the message “Start discussion” and “Error embedding”.

It’s not a consistent error, we couldn’t identify a pattern. There are pages rendering the comments normally, other pages, the error is present. In some browsers we see it working, others, don’t. Even in the same browser, it works for one of us and doesn’t work for others.

We’re tracking the error on this issue: Discourse comments - inconsistent errors (#132) · Issues · GitLab.com / GitLab Docs · GitLab, and so far didn’t find anything on our end. Could someone please check this for us? Thanks in advance!


(Marcia Ramos) #2

We’re currently on Discourse 1.9.0.beta13 - rolling back to 1.8 or upgrading to 1.19.0.beta14 (Releases · discourse/discourse · GitHub) could be a possible fix?


(Vinoth Kannan) #3

It’s look like your Allowed Hosts or Path Whitelist not matching the referrer URL in Discourse (in your case docs.gitlab.com and /some/path optional). Can you please double check the setting?

Are you running Discourse with our standard docker installation method?


(axil) #4

This is what we have:

and yes, we are running Discourse the official way via Docker.

Maybe we should add a path whitelist?


(Vinoth Kannan) #5

I think so. You should add “Path Whitelist” as .*


(axil) #6

The change should be instant, right? I tried with many variations, but all fail.

.*
.*\.html\z

The interesting thing is that it fails for specific pages for specific browsers. I also checked if there’s an X-Frame-Options header that would deny the iframe, but there isn’t:

curl -I https://docs.gitlab.com
              
HTTP/2 200 
accept-ranges: bytes
cache-control: max-age=600
content-type: text/html; charset=utf-8
expires: Mon, 06 Nov 2017 06:53:14 UTC
last-modified: Mon, 06 Nov 2017 04:23:19 GMT
vary: Origin
content-length: 13259
date: Mon, 06 Nov 2017 06:43:14 GMT

(axil) #8

Ok, new info. I just remembered that I had previously created a test category and all topics had already been populated. I now see that some pages point to the old topics. Maybe they conflict, so we’d need to purge all old topics and the old category itself. Using .* seems to work now.


(Vinoth Kannan) #9

That is the problem. Every time after a URL embedded then it will be stored in DB with referenced topic_id. Let me know if you are unable to purge it.


(axil) #12

@vinothkannans seems that works now, but we’ve noticed that in some cases the iframe is stuck at “Loading discussion…”. A page reload fixes it, though. I cannot find anything related in /logs.

I deleted all old topics and then the category itself, so there shouldn’t be any problems. Could this be a cache thing?


(axil) #13

We tested internally, and could not reproduce the “Loading discussion…” error! Consider this topic solved! Thanks all!


(Vinoth Kannan) #14

That’s good news :+1:


(Marcia Ramos) #15

Awesome, thanks everyone! :heart:


(Régis Hanol) #16