Support » Plugin: Disqus Comment System » [Plugin: Disqus Comment System] Auto Syncing Not Working

  • After switching from a WordPress host (laughingsquid) to ec2 using nginx, auto syncing stopped working, meaning when a new disqus comment is entered, it does not get inserted into mysql as a wordpress comment. Using the plugin Cron View, I checked that a cron entry is never made for the new comment.

    When looking at chrome js console, I see this:

    Resource interpreted as Script but transferred with MIME type text/html: “”.

    /title123/?cf_action=sync_comments&post_id=2861:1Uncaught SyntaxError: Unexpected token <

    I followed the information listed here:
    and it is able to sync by clicking the ‘sync comments’ button. Only auto sync is not working.

    Any ideas what could be the problem? Might it have to do with my nginx config?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Tyler Hayes


    That SyntaxError occurs when there’s an unexpected tag-opening < character in the source, and is likely unrelated to sync not working. Typically this happens when a post or page has a <script> or CDATA tag in the content of the post/page itself (i.e., not part of the theme; it’s literally added when writing a post/page).

    Cron entries for syncing are added when 1) a post is viewed live on your site itself, and 2) when a post is edited. Try performing one or both of those actions and then take a screenshot of what you see in “What’s in Cron?” It should look like this:

    There is no reference to dsq_sync_forum in the cron view page after editing a new comment, and refreshing the page as well.

    Since the comment is not actually synced to the mysql db this makes sense. The cron job is never submitted in the first place. The question remains why. I noted 2 problems in the js console, one having to do with the “<” token, which you say is probably unrelated, the other having to do with MIME. No php errors are generated at all.

    I refreshed various pages multiple times and always have this loaded:
    Resource interpreted as Script but transferred with MIME type text/html: “”.

    So it looks like it’s attempted to sync the comment without success. Any other ideas what could be causing this? Thanks.

    Plugin Contributor Tyler Hayes


    That MIME type warning is normal.

    Since ?cf_action=sync_comments is being output, that seems to imply that the issue is likely not in the plugin itself but potentially in either WP elsewhere or on the hosting level.

    Along those lines, this may be due to a conflict with your current theme or another plugin. To test this, try temporarily reverting to the default WordPress theme. If sync still doesn’t get added to the cron then, try temporarily disabling all plugins except Disqus. Make sure to either view/edit a post after each step to fire the cf_action. Let us know what you find.

    Also, any chance you’re able to look into your server logs and see if any errors show up there? Or is that what you’re referring to when you mention lack of PHP errors?

    I reverted from twenty-eleven child theme to default twenty eleven theme with same results. I then disabled all plugins except for disqus with the same results. The nginx error log did not show any errors. The php error log did not show any errors. I confirmed that ?cf_action=sync_comments is being reloaded when viewing various pages.

    The nginx config file contains the following:

    //global section
        gzip  on;
        gzip_comp_level 4;
        gzip_disable  "msie6";
        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
        gzip_buffers 16 8k;
    //wordpress site
            location ~* wp-admin {
              try_files $uri $uri/ =404;
                auth_basic            "Restricted";
                auth_basic_user_file  /webapps/.htpasswdlist;
            #    Keep images and CSS around in browser cache for as long as possible,
            #    to cut down on server load
              location ~* \.(js|css|png|jpe?g|gif|ico)$ {
                  expires 90d;
                  add_header Pragma public;
                  add_header Cache-Control "public, must-revalidate, proxy-revalidate";
            #    Common deny or internal locations, to help prevent access to areas of
            #    the site that should not be public
              location ~* wp-admin/includes { deny all; }
              location ~* wp-includes/theme-compat/ { deny all; }
              location ~* wp-includes/js/tinymce/langs/.*\.php { deny all; }
            #    Prevent any potentially-executable files in the uploads directory from
            #    being executed by forcing their MIME type to text/plain
              location ~* ^/wp-content/uploads/.*.(html|htm|shtml|php)$ {
                  types { }
                  default_type text/plain;

    Any other ideas? Can I turn on tracing somewhere to help figure out the problem?

    Plugin Contributor Tyler Hayes


    Try enabling DISQUS_DEBUG and see if anything irregular gets spit out — add the following to wp-config.php:

    define('DISQUS_DEBUG', true);

    Also can you include a dump of what you see when running tracert from your server?

    Also, just to double-check (I know you mentioned you looked at our doc in your first message, and nothing stuck out in your nginx config either, but better safe than sorry) you’re not blocking ports that would prevent access to or, specifically HTTP outbound port 80, correct?

    I enabled DISQUS DEBUG but it only displays:
    Disqus Debug thread_id:

    This is displayed after entering a new comment and refreshing on any page.

    The following displayed in the js console once but I cannot reproduce this after refreshing, adding comments, etc:
    XMLHttpRequest cannot load Origin is not allowed by Access-Control-Allow-Origin.

    Here are the results of traceroute

    traceroute to (, 30 hops max, 60 byte packets
    1 ( 0.369 ms 0.410 ms 0.440 ms
    2 ( 0.390 ms 0.422 ms ( 0.371 ms
    3 ( 0.647 ms 0.301 ms 0.481 ms
    4 ( 1.559 ms 1.210 ms 1.402 ms
    5 ( 1.375 ms ( 5.838 ms 5.793 ms
    6 ( 3.142 ms 2.995 ms ( 3.842 ms
    7 ( 4.479 ms ( 3.410 ms ( 5.028 ms
    8 ( 10.421 ms ( 4.289 ms ( 10.173 ms
    9 ( 10.698 ms 10.675 ms 10.624 ms
    10 ( 9.234 ms 9.681 ms 9.861 ms
    11 ( 78.290 ms ( 77.371 ms ( 81.449 ms
    12 ( 78.309 ms 78.258 ms ( 77.381 ms
    13 ( 77.340 ms ( 77.575 ms ( 78.881 ms

    I am using the default security group for ec2 which should allow all outbound requests. This is the content of iptables:

    Chain INPUT (policy ACCEPT)
    target prot opt source destination

    Chain FORWARD (policy ACCEPT)
    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)
    target prot opt source destination

    Is there something else I can do to check? Thanks.


    I also had a problem with comments not getting auto-synchronized. I am using nginx, php5-fpm and the Disqus plugin.

    The solution at the following URL helped:

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Disqus Comment System] Auto Syncing Not Working’ is closed to new replies.