Comments broken - can't seem to read or write comments tables

Hi, we've got a strange problem we've been unable to figure out: On a WP Multisite, one single sub-site has all comments are missing, and it 404's when we try to add a comment on a post. I've looked at the database via phpMyAdmin and the comments are all still there in the database. But you click the comments section in the admin, and nothing shows up there. Try to add a comment from the admin and it doesn't work from there either.

It's weird, it's like the comments & comments meta tables are still there, but WP can't read from or write to them. As far as I know it can read/write just fine on any other tables. I've tried repairing all tables and optimizing them from phpMyAdmin, but it seems to have no affect. We also tried a comment on another sub-site, that worked fine. We tried reverting to the TwentyTwelve theme and it still wouldn't work, so we assume it's not the theme. We also tried disabling all plugins, and that didn't help either. Any ideas? Has anyone seen this before?

Our hosting people said they've seen it before and never figured out a fix. The only thing they knew of was the work around of using a tool to export, then rebuild/re-deploy the entire site, or use something like BackupBuddy to export the sub-site then re-import it. I'm hoping someone has some other ideas. There must be a cause and solution.

  • Tevya
    • Recruit

    UPDATE: I just tried BackupBuddy and got an error:

    ERROR: Unable to access and dump database table 'wp_4_comments'. Table may not exist. Skipping backup of this table.

    So BackupBuddy can't read the table either, thus an export/import process like I mentioned won't work. I also tried exporting the comments and comments_meta tables then dropping them. I then imported them again. Doesn't appear to have changed anything.

  • Vaughan
    • Support/SLS MockingJay

    hiya

    very strange issue.

    that's the 1st suggestion i would have tried is to do a DB repair on the comments tables. when you did the repair, did you just select the comments tables or the whole lot? does it say anything if you run a check tables?

    have you tried doing an export of the comments tables in phpmyadmin, then deleting them & reimporting back? do the collations match with the others? (this shouldn't really cause this though)

    your host could possibly try increasing the mysql connection timeouts (sometimes that can cause corruption in the tables, if connections get closed whilst writing is in progress.) but it sounds like this may not be the cause.

    hope this helps

  • Tevya
    • Recruit

    See my followup comment: yeah I tried to export the tables. Then dropped them. Then imported. Is there a better/different way to do it? I tried optimizing just those 2 tables and all of the tables in the database. Checking the comments table just says "OK."

    We've actually got a dedicated MySQL server. Pretty sure the connection timeouts is not the problem. But I can have them check.

  • Tevya
    • Recruit

    So we've done more testing with this, and it's like that table is locked or something. We've renamed it, and created a new comments table to replace it and the new table is "stuck" too. WP can't write to it.

    We've tried the previous suggestions, but to know avail. It's just the 1 table: wp_4_comments that's affected.

  • Vaughan
    • Support/SLS MockingJay

    i'm not sure what else to suggest.

    i've only ever experienced this once before for myself, and I ended up having to create a new DB & copy over the old DB to the new 1.

    this is definitely more of a server/SQL DB issue than Wordpress from what i've read about it on google.

  • Tevya
    • Recruit

    Okay. Well if you think any of your colleagues might have any ideas, I'd appreciate any other thoughts/feedback (and I appreciate yours as well). We're in the process of using BackupBuddy to export the site (minus the comments table) to a single-site install and see if we can then import the table there. If that fixes it, we'll probably just move it to another multisite as it's really the only site on this multisite currently.

  • Tevya
    • Recruit

    Now that would make a lot of sense @Aaron if somehow it just didn't have proper permissions on that table. I know my way around phpMyAdmin doing the basics. But that's about it. Where would I put this in phpMyAdmin to run it?

    We actually already exported the entire site and moved it, that fixed it. However, my hosting support says they've run across this before and that was their only fix: moving to a new database. So if we can confirm your fix works on the old site (still works as a subdomain on the multisite) that would be great for them, for us, and anyone else who runs into this.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.