# How can I troubleshoot Discourse comments embedding feature?

**URL:** https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323
**Category:** Support
**Created:** [June 22, 2015, 3:19pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323 "2015-06-22T15:19:03Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![amercader](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amercader/32/116336_2.png) [@amercader](https://meta.discourse.org/u/amercader)
#### Post date: [June 22, 2015, 3:19pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/1 "2015-06-22T15:19:04Z")

</div>

Hi,

I’ve been trying for a while to embed Discourse comments on another site but still haven’t been able to make it work. I started following the instructions on this blog: [http://eviltrout.com/2014/01/22/embedding-discourse.html](http://eviltrout.com/2014/01/22/embedding-discourse.html) and later on I found other issues, which I was able to fix with guidance from topics on this forum.

I’m now at the stage where I think everything is set up correctly, but for some reason topics don’t get created on the Discourse side (when visiting a page on the client site, the embedded iframe only shows “Loading discussion”). I’ve double-checked (dozens of times actually) the embed settings on Discourse, the embed snippet on the client site (including the canonical URLs), logs, etc and couldn’t find anything wrong, so I started looking into something on our deployment setup.

I just wanted to clarify how the embedding works so I can investigate a bit further. My understanding is that whenever a user visits a page on the blog or site that embeds the comments, a request is made to Discourse, which will pull the referring page contents and create a topic on the fly if it does not exist (my site does not have an RSS feed).

My questions are:

- Is my assumption on how the embedding works correct?
- How could I debug if indeed Discourse is having trouble creating the topics from the remote site?

Apologies if this is somewhat obvious but I’m not familiar with Discourse or Rails

Many thanks in advance

---

<div class="post-metadata">

### Author: ![purldator](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@purldator](https://meta.discourse.org/u/purldator)
#### Post date: [June 22, 2015, 10:26pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/3 "2015-06-22T22:26:38Z")

</div>

Can you provide a screenshot to your Discourse embedding settings? What is powering the backend of your blog/site? Is it static html (from a generator) or WordPress or Ghost?

---

<div class="post-metadata">

### Author: ![amercader](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amercader/32/116336_2.png) [@amercader](https://meta.discourse.org/u/amercader)
#### Post date: [June 23, 2015, 9:19am UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/4 "2015-06-23T09:19:49Z")

</div>

@purldator here are my embed settings (sorry, I can’t embed images or link to them):

- embeddable hosts: **[ddhstaging.satapps.org](http://ddhstaging.satapps.org)**
- feed polling enabled: {unchecked}
- feed polling url: {blank}
- embed by username: **ddhdatasets**
- embed username key from feed: {blank}
- embed category: **Data Discovery Hub Datasets**
- embed post limit: 100
- embed truncate: {unchecked}
- embed whitelist selector: {blank}
- embed blacklist selector: {blank}

My site is a data catalog based on CKAN , pages are generated from templates. Here’s what the Discourse snippet looks like on [this page](http://ddhstaging.satapps.org/dataset/deimos-1):

```
  <div id="discourse-comments"></div>

<script type="text/javascript">
  var discourseUrl = 'http://forumstaging.satapps.org/',
      discourseEmbedUrl = 'http://ddhstaging.satapps.org/dataset/473cdee9-565c-4a9b-99a8-e8c836837086';

  (function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
      d.src = discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
  })();
</script>

```

Any pointers will be greatly appreciated.

---

<div class="post-metadata">

### Author: ![amercader](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amercader/32/116336_2.png) [@amercader](https://meta.discourse.org/u/amercader)
#### Post date: [June 24, 2015, 3:26pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/5 "2015-06-24T15:26:00Z")

</div>

Any pointers or ideas here would be greatly appreciated.

The rails log shows that the request is received correctly:

```
Started GET "/embed/comments?embed_url=http%3A%2F%2Fddhstaging.satapps.org%2Fdataset%2F473cdee9-565c-4a9b-99a8-e8c836837086" for 165.254.84.238 a
t 2015-06-24 15:14:27 +0000
Processing by EmbedController#comments as HTML
  Parameters: {"embed_url"=>"http://ddhstaging.satapps.org/dataset/473cdee9-565c-4a9b-99a8-e8c836837086"}
  Rendered embed/loading.html.erb within layouts/embed (0.9ms)
Completed 200 OK in 22ms (Views: 3.1ms | ActiveRecord: 5.9ms)

```

But nothing happens from there, no topics are created and on the client site the iframe keeps refreshing to the same Loading Discussion page. On the server, the `topic_embeds` table is empty.

I’ve tracked all the code up until [topic\_embed.rb](https://github.com/discourse/discourse/blob/master/app/models/topic_embed.rb) where the remote contents should get pulled, but looking at the traffic on the server it doesn’t seem that the contents are being requested, so something is failing before.

Any ideas on what could that be?

I’m using v1.4.0.beta3 +55

Many thanks,

---

<div class="post-metadata">

### Author: ![jqnatividad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jqnatividad/32/115589_2.png) [@jqnatividad](https://meta.discourse.org/u/jqnatividad)
#### Post date: [June 24, 2015, 8:16pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/6 "2015-06-24T20:16:00Z")

</div>

It seems that the following change broke embedding:

[https://github.com/discourse/discourse/commit/ae277e28a64840433141f8085ab9a080ebce5ef2](https://github.com/discourse/discourse/commit/ae277e28a64840433141f8085ab9a080ebce5ef2)

Embedding was working before on talk.beta.nyc and data.beta.nyc before this change.

@eviltrout, I noticed that [fishtank.eviltrout.com](http://fishtank.eviltrout.com) is on Discourse 1.4.0.beta1 which predates this change. Will it still work if its upgraded to the latest beta?

FYI, talk.beta.nyc is running on v1.4.0.beta3 +71.

Thanks!

P.S. @amercader, fancy seeing you here 😉

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 24, 2015, 8:34pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/7 "2015-06-24T20:34:32Z")

</div>

I don’t think so.. [http://discourse.codinghorror.com](http://discourse.codinghorror.com) is on 1.4 beta 3 and as you can see the comments are embedded fine there on [http://blog.codinghorror.com](http://blog.codinghorror.com) when you drill through to a blog entry.

---

<div class="post-metadata">

### Author: ![jqnatividad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jqnatividad/32/115589_2.png) [@jqnatividad](https://meta.discourse.org/u/jqnatividad)
#### Post date: [June 24, 2015, 8:45pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/8 "2015-06-24T20:45:11Z")

</div>

If its not too much of a bother, can you create a new test blog post on [blog.codinghorror.com](http://blog.codinghorror.com)?

I noticed that old embedded posts were showing up properly, but when you try to create a new embed, it fails.

---

<div class="post-metadata">

### Author: ![nigelb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nigelb/32/116279_2.png) [@nigelb](https://meta.discourse.org/u/nigelb)
#### Post date: [June 25, 2015, 7:50am UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/9 "2015-06-25T07:50:06Z")

</div>

Do you see [these error log entries](https://meta.discourse.org/t/embedding-comments-issue/30439/1) too? Open the page with the comments on Chrome with the JS console open and I see them come up after some time.

---

<div class="post-metadata">

### Author: ![amercader](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amercader/32/116336_2.png) [@amercader](https://meta.discourse.org/u/amercader)
#### Post date: [June 25, 2015, 8:29am UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/10 "2015-06-25T08:29:55Z")

</div>

Yes, I do see them. It only happens in Chrome, Firefox seems to work fine.

Not sure if it is related to the topics not being created on the Discourse site though.

 ![](https://global.discourse-cdn.com/meta/original/3X/c/1/c16ab33553d90988d2b17483ae6adf88baa3ebeb.png)

---

<div class="post-metadata">

### Author: ![amercader](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amercader/32/116336_2.png) [@amercader](https://meta.discourse.org/u/amercader)
#### Post date: [June 25, 2015, 11:09am UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/11 "2015-06-25T11:09:51Z")

</div>

I can confirm that rebuilding the Discourse site from scratch targeting v1.4.0.beta1 fixes the embedding. So it seems like some sort of regression has happened on the meantime (probably what @jqnatividad mentions).

---

<div class="post-metadata">

### Author: ![jqnatividad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jqnatividad/32/115589_2.png) [@jqnatividad](https://meta.discourse.org/u/jqnatividad)
#### Post date: [June 25, 2015, 6:53pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/12 "2015-06-25T18:53:00Z")

</div>

Yep @nigelb, @amercader, I can confirm that we’re getting the same errors ourselves.

It’s good to know that embedding works again when using 1.4.0beta1.

---

<div class="post-metadata">

### Author: ![ziirish](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ziirish/32/116351_2.png) [@ziirish](https://meta.discourse.org/u/ziirish)
#### Post date: [June 26, 2015, 9:09am UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/13 "2015-06-26T09:09:20Z")

</div>

Hi, I can confirm too:

- v1.4.0.beta1 is working fine
- v1.4.0.beta3 does not create the topics automatically

Unfortunately, I cannot seem to be able to reproduce the JS errors.

---

<div class="post-metadata">

### Author: ![jmamazo](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jmamazo](https://meta.discourse.org/u/jmamazo)
#### Post date: [June 26, 2015, 11:48am UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/14 "2015-06-26T11:48:17Z")

</div>

Hi there.  
How do I roll back the update? I have searching but not much luck.

Thanks

---

<div class="post-metadata">

### Author: ![ziirish](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ziirish/32/116351_2.png) [@ziirish](https://meta.discourse.org/u/ziirish)
#### Post date: [June 26, 2015, 2:03pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/15 "2015-06-26T14:03:56Z")

</div>

You can’t do the downgrade easily because database changes occurred between beta1 and beta3.  
You’ll have to restore a database backup prior to the upgrade if you can.

Anyway, to install a fixed version of discourse, you can add the following lines in your _container.yml_ file:

```plaintext
params:
  version: v1.4.0.beta1

```

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [June 26, 2015, 2:46pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/16 "2015-06-26T14:46:08Z")

</div>

I’m looking at this today. Hopefully I’ll have a solution soon.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [June 26, 2015, 3:47pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/17 "2015-06-26T15:47:29Z")

</div>

Okay sorry guys! There was indeed a bug here. It was serious enough that I’ve updated the latest beta to include it too. So if you are tracking beta just upgrade and you’ll get the patch.

[https://github.com/discourse/discourse/commit/008dd967217f844c1ad0eb989030c6250d673b69](https://github.com/discourse/discourse/commit/008dd967217f844c1ad0eb989030c6250d673b69)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 26, 2015, 6:57pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/18 "2015-06-26T18:57:16Z")

</div>

Where is our

![](https://global.discourse-cdn.com/meta/original/3X/4/0/404241d3eed069ddd838ffafee8e1a8b120f938f.jpg)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 26, 2015, 7:29pm UTC](https://meta.discourse.org/t/how-can-i-troubleshoot-discourse-comments-embedding-feature/30323/19 "2015-06-26T19:29:27Z")

</div>


