The MU forums have moved to WordPress.org

Database error after upgrade to 1.2.2 (13 posts)

  1. Konstan
    Member
    Posted 17 years ago #

    Well, I just recently discovered the wonders of error_log so I've been checking it regularly to see whats up. So, I just checked it and I have 4 database errors for today since I upgraded last night.

    The error shows up like this:

    [23-Jun-2007 16:46:01] WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 10' at line 1]
    SELECT wp_83_comments.* FROM wp_83_comments WHERE comment_post_ID = AND comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 10

    And they are all the same, but from different wp_blogid sources. I have no idea what file is doing that, maybe a theme that is not compatible? How can I find out, and most importantly, fix it?

    Thanks.

  2. drmike
    Member
    Posted 17 years ago #

    Did you run the Site Admin -> Upgrade script?

  3. Konstan
    Member
    Posted 17 years ago #

    I did, but I think it didnt work all the way. I have 1350 blogs but the upgrade script only got to something like 1150 before it said All Done!

    Should I try running it again?

    EDIT: Just ran it again and it said All Done at wp-admin/wpmu-upgrade-site.php?action=upgrade&n=1140 and if I check my blogs, the last blog ID is 1316

  4. Konstan
    Member
    Posted 17 years ago #

    Well, everything was going fine today but the errors are back :(

  5. drmike
    Member
    Posted 17 years ago #

    Check your webserver's logs and see what the url was at the time that error was produced. Note that the comment_post_ID field is empty. That is what is causing the error. Just have to figure out why it's occuring.

  6. Konstan
    Member
    Posted 17 years ago #

    Ok, the errors are being generated from 5 blogs, I checked them today and they all have different themes so its probably not that. I checked the comments and tried posting one in each of the blogs and it worked flawlessly. No errors.

    Is there any way to include what file causes the error so it gets logged into error_log?

  7. drmike
    Member
    Posted 17 years ago #

    Best bet would be to match it up with your webserver's log (not the error log but the real log) as the time stamps will be the same.

  8. Konstan
    Member
    Posted 17 years ago #

    My cpanel log doesnt show anything. I tried the last 300 visitors log to see what file was accessed but I got so many hits that I couldnt do it, will try again later.

  9. Konstan
    Member
    Posted 17 years ago #

    Ok, for some reason it wont let me post a big post here so I have a link to a text file:

    http://bloghost.cl/bloghost_error_galore.txt

    I found out about what is (probably) the cause of it all. If anyone could help me by telling me why its doing that, I'll be happy :P

  10. Konstan
    Member
    Posted 17 years ago #

    Still can't fix it :(

  11. Konstan
    Member
    Posted 17 years ago #

    Hmm, this is getting annoying :s I've tried checking the files but there is nothing wrong with them :-\

  12. andrea_r
    Moderator
    Posted 17 years ago #

    Well, from a quick scan of the error logs, it looks like some random spammer guy is trying to leave comments on entries that no longer exist.

  13. Konstan
    Member
    Posted 17 years ago #

    Yeah, but why does it generate that error? Could it be a code error, or just the spam software causing it?

About this Topic