Skip to:
Content
Pages
Categories
Search
Top
Bottom

Now it's there, now it's gone…


  • David Anderson
    Participant

    @davidanderson

    I recently installed bbPress 2.5.4, and imported a load of data from a Mingle Forum install.

    All seemed to be going well…

    Unfortunately, sometimes when forum pages (pages under the /forums/ hierarchy) are loaded, there is the content; sometimes they are blank.

    It’s not a PHP fatal error, or out-of-memory: no PHP errors are logged, and the HTML delivered is complete right down to the closing /html; it’s just that the section where there should be bbPress content is empty.

    I’ve tried setting up pages that use shortcodes to display the forums instead – and these pages *always* work. It’s the pages that are going through the permalink structure which sometimes work, sometimes don’t.

    There’s no apparent pattern I can discern in when it works and does not. I just hit “reload” lots of times – and sometimes it works, and sometimes doesn’t. The only pattern is that when it flips from not working to working, or vice-versa, then it tends to stay that way for a few reloads – across browsers too.

    I’ve tried re-saving my permalink structure, several times – this makes no difference. I put an mu-plugin which always called flush_rewrite_rules() on every page load; no difference.

    Example URL: http://updraftplus.com/forums/topic/updraft-migration-issue/ – try reloading a few times, and/or waiting a few minutes, and see the result change.

    Example of things not working: http://snag.gy/Sr9eX.jpg … so, I hit reload a few times, and then it works: http://snag.gy/BzTAA.jpg

    Also: my /forums/ page has other text at the top (i.e. text entered in the textarea when editing the page in the WP dashboard). When not working, none of that text is displayed either – i.e. not just the forum index is missing, but everything.

    Currently, the HTTP server is set up to redirect requests to /forums/ and to the forum index so that they go to pages which use shortcodes. But, the topic links are always linked by the resulting output into the sometimes-works, sometimes-doesn’t permalink structure.

    Anyone got any ideas? Theme: Pagelines. WP Super Cache is installed, but there is no cacheing of /forums/ or anything beneath (confirmed that this is working by searching in wp-content/cache/).

    Many thanks,
    David

Viewing 19 replies - 1 through 19 (of 19 total)

  • David Anderson
    Participant

    @davidanderson

    P.S. A few consecutive Apache log lines – note how the number in bytes delivered changes:

    1.2.3.4 - - [12/Aug/2014:20:00:09 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 74091
    1.2.3.4 - - [12/Aug/2014:20:00:15 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 74091
    1.2.3.4 - - [12/Aug/2014:20:00:32 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 74091
    1.2.3.4 - - [12/Aug/2014:20:01:07 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 74091
    1.2.3.4 - - [12/Aug/2014:20:02:28 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 39159
    1.2.3.4 - - [12/Aug/2014:20:02:36 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 74091
    1.2.3.4 - - [12/Aug/2014:20:03:48 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 39159
    1.2.3.4 - - [12/Aug/2014:20:04:30 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 39159
    1.2.3.4 - - [12/Aug/2014:20:04:39 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 39159

    Stephen Edgar
    Moderator

    @netweb

    Weird, I just refreshed the topic page you linked to and after half a dozen reloads tyhe page is now blank and still trying to reload (Timestamp %:57pm Local Time if you go looking at your logs), If I insopect the page with Google Chrome inspector I have a console error Failed to load resource: net::ERR_CACHE_MISS. Right now (5:59pm) the page just finished loading and looks like what the previous refreshes looked like, I do have a new console log error though for jquery-migrate.min.js.

    
    HTTP/1.1 304 Not Modified
    Uncaught SyntaxError: Unexpected number 
    Server: cloudflare-nginx
    Date: Wed, 13 Aug 2014 07:56:31 GMT
    Connection: keep-alive
    Last-Modified: Wed, 06 Aug 2014 21:12:37 GMT
    ETag: "261795-1c20-4fffc6e7d6bab"
    CF-BCK-Digest: {"bck_type":"BCK_C3","up_stat":"304"}
    CF-Cache-Status: HIT
    X-Accel-Buffering: yes
    Vary: Accept-Encoding
    Expires: Thu, 14 Aug 2014 07:56:31 GMT
    Cache-Control: public, max-age=86400
    

    Possibly a ‘Cloudflare’ cache issue otherwise not sure what else this could be as you note it is not consistent, maybe try creating a new forum with a topic and reply and try to replicate it using those and if it matters if the user is logged in or not. Also does this happen with any pages or posts on your site?


    David Anderson
    Participant

    @davidanderson

    Hi Stephen,

    Thanks for getting back. Too right that it’s weird! It’s definitely not a browser or CloudFlare or WP Super Cache cache issue – that was what I was investigating when I posted the Apache logs. You can see that successive log entries deliver different numbers of bytes, e.g.:

    1.2.3.4 - - [12/Aug/2014:20:02:36 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 74091
    1.2.3.4 - - [12/Aug/2014:20:03:48 -0400] "GET /forums/topic/updraft-migration-issue/ HTTP/1.1" 200 39159

    74091 bytes corresponds to a page load when the forum appeared; 39159 corresponds to that portion being blank (when I hit “reload”, 10 seconds later). It goes back and forth like that with no apparent pattern – you can’t predict what’s next.

    Just to make sure I also tested with WP Super Cache deactivated (it had nothing in wp-content/cache for these pages anyway), and CloudFlare in developer (no cacheing) mode, and emptied the CloudFlare cache.

    Also, when the forum is produced by a shortcode, it works 100% of the time. No other pages on the site do this, or ever have done. The previous forum plugin (Mingle Forum) is both de-activated and removed, so it’s not that interfering.

    So, it seems certain to me that it’s something to do with permalink hierarchy.

    Any suggestions how I can debug this? I have 100% access to everything. But, I’m more of a back-end developer – stuff to do with permalinks and custom post types is stuff I’ve only dabbled in, and I’m not sure where to start diving in. It’s easily reproducible (just keep hitting reload enough times, and the behaviour will change).

    David


    David Anderson
    Participant

    @davidanderson

    P.S. Forgot to mention – CloudFlare doesn’t cache HTML in any case, unless explicitly configured to. I’ve not configured it to.


    David Anderson
    Participant

    @davidanderson

    Hi,

    I would love to get some advice on where to dive into the code to look at this. Everything must be set up correctly – because otherwise, it would never work. What functions should I start looking at to see what isn’t getting called that should be?

    David


    Stephen Edgar
    Moderator

    @netweb

    I see your using a Pagelines theme, are you using the Pagelines bbPress plugin? (You need this for Pagelines themes last time I looked)


    David Anderson
    Participant

    @davidanderson

    Yes, I am. If you don’t use the pagelines-bbpress plugin, then it prints a big banner telling you that it won’t display the forum until you do so!


    Stephen Edgar
    Moderator

    @netweb

    Hmmmm…. I’ve still got nothing new to add… The past few days everytime I glance past this in my browser I open up this link and I have not seen bbPress in there once in these past couple of days.

    There has to be a common denominator somewhere, maybe a recent plugin or theme update, I’d start by disabling each plugin one by one you have activated and refresh that page after you disable each plugin.


    David Anderson
    Participant

    @davidanderson

    Hi Stephen,

    It’s not likely to be a recent update – I actually only started using bbPress a couple of weeks ago. I migrated from Mingle Forum.

    It’s also still working sometimes for me, and for others (who are still using the forum).

    I will try what you suggest and let you know what I find!

    Best wishes,
    David


    Stephen Edgar
    Moderator

    @netweb

    Yeah, that’s typically the first response here on bbpress.org, try disabling plugins, switch themes etc

    Thus once that’s out of the way and out of the way that we haven’t missed something obvious… ;)


    David Anderson
    Participant

    @davidanderson

    Hi,

    I’ve disabled all plugins except for BBPress and Pagelines-BBPress (which is required – otherwise you get an error that tells you it’s required…), and the fault was still reproducible.

    Now I’m looking at the theme…. but my forum is now working 100% of the time for me during testing, whether with changes or not – so I’ll have to wait for it to revert to broken behaviour again before I can get any further……

    David


    Stephen Edgar
    Moderator

    @netweb

    Ok, I CAN see the content at http://updraftplus.com/forums/topic/updraft-migration-issue/

    So this IS progress :) Any recent theme updates or tweaks you made?


    David Anderson
    Participant

    @davidanderson

    Hi Stephen,

    There’s no progress there – nothing’s yet been changed! i.e. I re-enabled the plugins after disabling them. And, whilst you couldn’t, I could see the page before disabling them. So, nothing seems to have changed yet – i.e. it’s still “now you see it, now you don’t…”

    David


    Stephen Edgar
    Moderator

    @netweb

    Ahhh… Now I’m looking at the theme…. <- That part of your previous post I inferred you were ‘looking’ at your theme and had found ‘something’ that a change you made had reverted the bad behaviour.

    I’m still seeing the page so that makes two times more than the past few days, it ‘could’ be just one of those things that by deactivating one of those plugins and then reactivating it again has fixed whatever, rare, but has been known to happen in the WordPress plugin world!


    David Anderson
    Participant

    @davidanderson

    Hi Stephen,

    Unfortunately, it’s not the plugin re-activation that’s done anything – I can still reproduce the “it’s not there” as well as the “it is there”. (I got one just now).
    And also, I didn’t de-activate or re-activate using the control panel; I used a filter hook to remove entries from the “active_plugins” option when the URL began with /forums.

    I will keep seeing what I can find… I have hacked in a theme over-ride based on a URL parameter. So far, I have had zero failures with that – but only 1 failure on the current theme since I started trying, so not enough to tell me anything yet.

    David


    Stephen Edgar
    Moderator

    @netweb

    Yep, sigh, it’s gone for me now to https://i.cloudup.com/CpVrLotdFm.png :(


    David Anderson
    Participant

    @davidanderson

    Hi Stephen,

    Does

    https://updraftplus.com/forums/topic/updraft-migration-issue/?theme_override=1

    work (leaving aside the ugliness of an unconfigured default setup for that theme) for you? I’ve not had a failure yet.

    David


    Stephen Edgar
    Moderator

    @netweb

    Yes, that works :)

    Yes it’s ugly ;)

    It’s a start to start to isolate what the root issue is though :)


    David Anderson
    Participant

    @davidanderson

    After getting deep into the guts of Pagelines, I think this is now fixed… first of all, thanks very much Stephen for being willing to assist. It’s been very good of you.

    In case the autopsy helps anyone else, here we go…

    There was a transient that Pagelines uses – pagelines_sections_cache – that keeps a record of what different section types are registered with the Pagelines theme.

    I haven’t worked out why yet (and won’t try), but though this transient is meant to last 24 hours, it would get re-generated more frequently than that. That plays into what follows.

    Pagelines (in my view) runs some of its code much too early on the front-end, unconditionally – and sometimes it was re-generating the transient on requests that another of our plugins was picking up for API calls (i.e. calls that don’t generate a front-end page). On those requests, for performance, the pagelines-bbpress plugin was not active. As a result, the BBPress section type did not get registered with Pagelines. The transient got saved without knowledge of that section type.

    Thus, later, when the cached transient was getting used, no BBPress section type was known – so Pagelines would output nothing.

    And here’s the really annoying bit. What was the magical BBPress/Pagelines integration code that they used to sell in their store but now give away in the Pagelines-BBPress plugin? What is the wonderful code to get the two to work together? When you scrape away all the boilerplate to find the core code that does something, the whole of it is:

    function section_template() { 
                    while (have_posts()) :
                            the_post();
                            the_content();
                    endwhile;
            }

    Excuse me whilst I go and bang my head against a wall for a bit.

    David

Viewing 19 replies - 1 through 19 (of 19 total)

You must be logged in to reply to this topic.