• I am one of the WP hardcore users and I am developing themes for WP since version 1.5. But once in a while, after upgrading to new WP versions, some errors occur. Most of them are resolved in a short time.

    Now here’s the problem: I have my own custom theme written on my own keyboard, I don’t use more than 10 light plugins, so /wp-content/ code is not the cause.

    The thing is, a few times a day, the database connection basically dies. What do I mean by that? The WP install IS connected to the MySQL database, but no data is shown on the blog nor in Dashboard.

    Now, if it were a database connection error, there should have been the traditional “Couldn’t establish a database connection” error. But it’s not there.

    First, I thought it’s my server. I asked for the guys at the hosting company to check it out, they found nothing wrong, no SQL connection dropped whatsoever. So there has to be a problem in the WordPress core, but I have no idea where exactly.

    Second, the same problem occured a few days ago on a different blog hosted on a “space-rocket-speedy” server (it belongs to a huge media outlet). I thought they only had a small server issues, as media outlets have once in a while, so I didn’t bother too much. But today, doing some maintainance work (removing a banner from a sidebar, lol), I got the same error once more, this time on a third blog.

    Now, they say if one tells you that you’re drunk, ignore him, if two tell you that you drank to much, stop drinking, but if three tell you that you had enough, you should go to sleep. It’s already the third case I’m dealing with and it’s not the database connection. It never dropped on neither of the three blogs, each located on different servers with different sysadmins workign on them.

    Any ideas?

Viewing 15 replies - 1 through 15 (of 16 total)
  • How have you concluded that the plugins are not to blame? A large proportion of WordPress issues are plugin related. Have you disabled them all for enough time to conclude that they are not causing the issue?

    Thread Starter subiectiv

    (@subiectiv)

    Dude, did you actually read all I wrote above?
    I use WP since version 1.2, trust me, I know what plugins I use, plus they’re all updated to the latest version.
    I disabled plugins and enabled them back. That’s the first thing I’ve done. I’m not some kinda newbie when it comes to WP. I’m looking for a solution and it’s not about others’ blogs, it’s my blog involved as well.
    If you have any idea where this problem has its root, shoot. Otherwise, it’s like you’d be saying: “Oh, your computer crashed and the system doesn’t boot anymore? Then please restart”.

    Yes I read it. I also read many things exactly like that every day where people come and say that it’s not this and it’s not that, and, well, lo and behold, they then actually disable plugins or switch to the default theme and the problem goes away.

    Thread Starter subiectiv

    (@subiectiv)

    Well, thanks, but restarts won’t help 🙂

    Just because you don’t think it’s theme or plugin code, doesn’t mean it isn’t and being upto date is not synonymous with having a properly functioning plugin/theme.

    By no means am i saying that theme or plugin code is definately at fault, i’m simply saying you shouldn’t disregard it as a possibility so easily. I also run my own code, i write my own plugins(theme hacks, etc..) but i still remove/disable them when troubleshooting a problem.

    — moving on though —

    Can you tell us any more about how the site(s) behave when this problem occurs, what exactly do you mean by no data is shown in the blog or dashboard, can you clarify what you mean by data (ie. the text? the images? both? something else?). Do the error logs show anything that coincides with the times this problem occurs?

    Are these sites on the same host or differing hosts? Do they have differing verisons of PHP/MySQL or use the same? Let’s try to find some common denominators for the problem sites (aside from WP of course).

    🙂

    Thread Starter subiectiv

    (@subiectiv)

    OK, it’s like this:

    One site on my host, two sites on a media outlet host, but on different machines, PHP/MySQL required for future versions of WP, so up-to-date :), nothing in the error logs.

    When the problem occurs, WP is still connected to the database, but no info is shown. Think about a WP theme 404 error page. That’s what it shows on the front page, while in Dashboard, in the Right now panel, I get “0 posts, 0 pages, 0 comments, 0 categories, 0 tags”. It’s like a fresh WP install but without the default post.

    After 20 or 30 seconds and a page refresh, everything comes back to normal.

    So in terms of what you see visually all the appropriate text, images and whatnot is shown, it’s just as if there’s nothing in the database.

    Now i think about it, i’ve had the 404 thing on my main page a couple of times myself as if nothing existed in the DB, in any case i never thought to login and check the admin side, because i’ve always gone and restarted the server, which has fixed the problem each time.

    Sometimes i start up the server and the MySQL service isn’t quite running correctly, when this happens i simply restart the server. The WordPress pages load, but everything is a 404 page (like you described – as if no posts exist).

    If it’s the same problem it would strike me as being a little odd that it happens a few times a day, unless your host is restarting the mysql service or servers several times a day, in which case, there could times when the service is not loading/starting up correctly (and assuming my problem is the same as the one you’ve described).

    Might be unrelated problems, but figured i’d mention my experience as i have had something similar (or possibly the same) happen.

    Thread Starter subiectiv

    (@subiectiv)

    @mark: my blog is hosted “on a rocket”, in the “root” of a cluster, at webfactor.ro. If you were to ask those guys, they’ll tell you they sure know my problem and have no idea what causes it. And they’re damn good in what they do. But that’s just my blog.

    The other two blogs are on a media outlet server located in a huge datacenter that only provides hosting for huge corporations. Now, I guess they’re professional enough to know, plus I know the media outlet’s sysadmin, who’s some sort of a god in terms of managing servers (and I don’t say that often). Same thing.

    So what I could figure out is that it can’t be the servers’ fault, it must be some sort of bug in the WP core. It only happened to me after upgrading to WP 3.0, never before.

    The thing is, I only am a designer with front-end developer skills, my PHP knowledge resumes to tweaking WordPress and writing custom themes and functions from scratch (midlevel PHP knowledge or smth). I’m not that good as a programmer to actually hunt bugs in the WP core’s code. I’m working on it :)), but didn’t got to that level yet.

    Admittedly i’m no server or coding guru either, and i’m not sure what to suggest.

    When the posts fail to show, what do you see in the admin side? Do dashboard widgets appear as normal?

    Does the posts page show “No posts found” or can you not even get the edit posts page up?

    Can you tell me more about what you do see when this problem occurs (rather than what’s missing).

    Do these websites use any custom rewrite rules?

    Thread Starter subiectiv

    (@subiectiv)

    Here’s what I see.
    I wrote on my blog about that, though you probably should use Google Translate to actually understand something.
    Anyway, there’s a printscreen picture at that URL. All works like a charm, but shows like having an empty database.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Have you tried repairing the database yet?

    Access your WordPress database via phpMyAdmin (most hosting providers offer this in their control panel), check all of the tables, and choose “Repair tables” from the pull-down menu.

    Thread Starter subiectiv

    (@subiectiv)

    @james: I use WP-Optimize for that, I optimeze database tables once a day or so. Plus, I did repaired all tables from phpMyAdmin two times, in the idea that WP-Optimize didn’t do it right. It’s not from there.

    Not suggesting it’s definately the same problem, but this does sound very similar to some of these issues.

    http://wordpress.org/support/topic/no-posts-found-on-new-install
    http://wordpress.org/support/topic/published-146-no-posts-found
    http://wordpress.org/support/topic/php-53-404-error-amp-no-posts-found

    I see the dashboard widget shows 0 for posts, pages, etc.. What do you see when you view the “Edit” posts list? Do the links for posts, “All”, “Published”, “Drafts” , etc.. list a count of posts, or again just 0.

    Thread Starter subiectiv

    (@subiectiv)

    @mark: the thing is, though it shows nothing in the dashboard, after clicking “posts” or “comments”, it will take up to a minute or two for loading the page. And curiously enough, it shows the list of posts. Basically, it all goes back to normal, but I have this 1-2 minutes gap when it shows nothing.

    So what errors do you see with debugging enabled?

    There was a good suggestion here on debugging.
    subiectiv.ro/netu/o-problema-de-wordpress-si-sql-caut-ajutor/#comment-291269

    The regular debugging method..

    define('WP_DEBUG', true);

    WP-Optimize will generate at least one error because it references a deprecated value when registering it’s plugin page, so it’s highly unlikely you won’t see any unless you or the host are explicitly forcing error suppression.

    Can you provide a list of the plugins you use, aside from WP-Optimize please. I’ve already tested WP-Optimize, and it doesn’t appear to cause any problems, apart from a deprecated warning that i mentioned above (quite good considering it’s not even listed as 3.0 compatible).

    Additionally (i asked before but you might of missed it), do you have custom rewrite rules in place on any of the problem sites? If so, can you detail how they are implemented, ie. directly in the htaccess file or via WordPress functions.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘WP bug / WP – SQL data pulling error’ is closed to new replies.