WordPress.org

Ready to get started?Download WordPress

Forums

Disqus Comment System
Auto Syncing Not Working (8 posts)

  1. bt7689
    Member
    Posted 2 years ago #

    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: "http://www.website.com/title123/?cf_action=sync_comments&post_id=2861".

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

    I followed the information listed here: http://docs.disqus.com/help/87/
    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?

    http://wordpress.org/extend/plugins/disqus-comment-system/

  2. Tyler Hayes
    Member
    Plugin Contributor

    Posted 2 years ago #

    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: http://dl.dropbox.com/u/15229959/Screenshots/seh8lq7rylfz.png

  3. bt7689
    Member
    Posted 2 years ago #

    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: "http://www.website.com/title123/?cf_action=sync_comments&post_id=2861".

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

  4. Tyler Hayes
    Member
    Plugin Contributor

    Posted 2 years ago #

    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?

  5. bt7689
    Member
    Posted 2 years ago #

    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?

  6. Tyler Hayes
    Member
    Plugin Contributor

    Posted 2 years ago #

    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 disqus.com 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 disqus.com or disqus.net, specifically HTTP outbound port 80, correct?

  7. bt7689
    Member
    Posted 2 years ago #

    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 http://qq.disqus.com/133720758484040884/691227687/. Origin http://mediacdn.disqus.com is not allowed by Access-Control-Allow-Origin.

    Here are the results of traceroute disqus.com

    traceroute to disqus.com (74.86.190.242), 30 hops max, 60 byte packets
    1 ip-10-160-148-5.us-west-1.compute.internal (10.160.148.5) 0.369 ms 0.410 ms 0.440 ms
    2 ip-10-1-14-1.us-west-1.compute.internal (10.1.14.1) 0.390 ms 0.422 ms ip-10-1-12-1.us-west-1.compute.internal (10.1.12.1) 0.371 ms
    3 216.182.236.75 (216.182.236.75) 0.647 ms 0.301 ms 0.481 ms
    4 205.251.229.232 (205.251.229.232) 1.559 ms 1.210 ms 1.402 ms
    5 205.251.229.232 (205.251.229.232) 1.375 ms 205.251.229.178 (205.251.229.178) 5.838 ms 5.793 ms
    6 te1-7.bbr01.eq01.sjc01.networklayer.com (206.223.116.176) 3.142 ms 2.995 ms 205.251.229.178 (205.251.229.178) 3.842 ms
    7 ae7.bbr02.eq01.sjc02.networklayer.com (173.192.18.165) 4.479 ms te1-7.bbr01.eq01.sjc01.networklayer.com (206.223.116.176) 3.410 ms ae7.bbr02.eq01.sjc02.networklayer.com (173.192.18.165) 5.028 ms
    8 ae0.bbr02.cs01.lax01.networklayer.com (173.192.18.151) 10.421 ms ae7.bbr02.eq01.sjc02.networklayer.com (173.192.18.165) 4.289 ms ae0.bbr02.cs01.lax01.networklayer.com (173.192.18.151) 10.173 ms
    9 ae0.bbr02.cs01.lax01.networklayer.com (173.192.18.151) 10.698 ms 10.675 ms 10.624 ms
    10 ae7.bbr01.cs01.lax01.networklayer.com (173.192.18.166) 9.234 ms 9.681 ms 9.861 ms
    11 ae0.dar01.sr01.dal01.networklayer.com (173.192.18.253) 78.290 ms ae0.dar01.sr01.dal01.networklayer.com (173.192.18.211) 77.371 ms ae0.dar01.sr01.dal01.networklayer.com (173.192.18.253) 81.449 ms
    12 ae0.dar01.sr01.dal01.networklayer.com (173.192.18.253) 78.309 ms 78.258 ms po1.fcr01.sr01.dal01.networklayer.com (66.228.118.154) 77.381 ms
    13 po1.fcr01.sr01.dal01.networklayer.com (66.228.118.154) 77.340 ms 74.86.190.242-static.reverse.softlayer.com (74.86.190.242) 77.575 ms po2.fcr01.sr01.dal01.networklayer.com (66.228.118.158) 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.

  8. epipe-com
    Member
    Posted 2 years ago #

    Hi,

    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:

    http://serverfault.com/questions/231578/nginx-php-fpm-where-are-my-get-params

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic