# Discourse embed: inconsistent errors

**URL:** https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367
**Category:** Support
**Created:** [November 3, 2017, 3:23pm UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367 "2017-11-03T15:23:47Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![marcia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcia/32/120567_2.png) [@marcia](https://meta.discourse.org/u/marcia)
#### Post date: [November 3, 2017, 3:23pm UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/1 "2017-11-03T15:23:47Z")

</div>

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.org / GitLab Docs DEPRECATED · GitLab](https://gitlab.com/gitlab-com/gitlab-docs/issues/132), and so far didn’t find anything on our end. Could someone please check this for us? Thanks in advance!

---

<div class="post-metadata">

### Author: ![marcia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcia/32/120567_2.png) [@marcia](https://meta.discourse.org/u/marcia)
#### Post date: [November 3, 2017, 7:42pm UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/2 "2017-11-03T19:42:51Z")

</div>

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](https://github.com/discourse/discourse/releases)) could be a possible fix?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [November 3, 2017, 8:36pm UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/3 "2017-11-03T20:36:33Z")

</div>

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](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md)?

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [November 4, 2017, 6:00am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/4 "2017-11-04T06:00:10Z")

</div>

This is what we have:

 ![com-2017-11-04-07-57-51](https://global.discourse-cdn.com/meta/original/3X/8/6/8681c46570b6c961e5c0ac2975b9cda1aeb5a4d0.png)

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

Maybe we should add a path whitelist?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [November 4, 2017, 6:34am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/5 "2017-11-04T06:34:08Z")

</div>

> [@Comments not embedding, 500 Error](https://meta.discourse.org/t/comments-not-embedding-500-error/57447/15):
>
> I bet you have Path Whitelist of \* and it should be .\*

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

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [November 6, 2017, 6:45am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/6 "2017-11-06T06:45:05Z")

</div>

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

```plaintext
.*
.*\.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:

```plaintext
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

```

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [November 6, 2017, 6:55am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/8 "2017-11-06T06:55:51Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [November 6, 2017, 7:18am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/9 "2017-11-06T07:18:59Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [November 6, 2017, 10:26am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/12 "2017-11-06T10:26:16Z")

</div>

@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?

---

<div class="post-metadata">

### Author: ![axil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axil/32/81682_2.png) [@axil](https://meta.discourse.org/u/axil)
#### Post date: [November 6, 2017, 10:47am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/13 "2017-11-06T10:47:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [November 6, 2017, 10:54am UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/14 "2017-11-06T10:54:00Z")

</div>

That’s good news 👍

---

<div class="post-metadata">

### Author: ![marcia](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcia/32/120567_2.png) [@marcia](https://meta.discourse.org/u/marcia)
#### Post date: [November 6, 2017, 1:27pm UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/15 "2017-11-06T13:27:11Z")

</div>

Awesome, thanks everyone! ❤

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 6, 2017, 9:25pm UTC](https://meta.discourse.org/t/discourse-embed-inconsistent-errors/73367/16 "2017-11-06T21:25:08Z")

</div>


