Skip to:
Content
Pages
Categories
Search
Top
Bottom

Database Errors


  • Mike Witt
    Participant

    @mike80222

    Any advice on debugging the error below?
    WordPress 5.9.2, BuddyPress 10.1.0, bbPress 2.6.9
    (I haven’t upgraded to 10.2.0 yet, but I don’t see any fixes that seems to apply to this.)
    It happens “once in a while” since upgrading to 10.1.0. (Four times since March 9th.)
    It *might* be related to email notifications (mentions?) in a bbPress closed topic.

    [09-Mar-2022 17:13:53 UTC] 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 user_id = 1348 AND component_name = 'messages' AND component_action = 'new' at line 1 for query UPDATE wp_bp_notifications SET is_new = 0 WHERE item_id IN () AND user_id = 1348 AND component_name = 'messages' AND component_action = 'new_message'
    made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/generatepress/page.php'), generate_do_template_part, get_template_part, locate_template, load_template, require('/themes/generatepress/content-page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, bp_replace_the_content, apply_filters('bp_replace_the_content'), WP_Hook->apply_filters, BP_Members_Theme_Compat->single_dummy_content, bp_buffer_template_part, bp_get_template_part, bp_locate_template, load_template, require('/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php'), bp_get_template_part, bp_locate_template, load_template, require('/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php'), bp_get_template_part, bp_locate_template, load_template, require('/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php'), bp_thread_the_message, BP_Messages_Thread_Template->the_message, do_action('thread_loop_start'), WP_Hook->do_action, WP_Hook->apply_filters, bp_messages_screen_conversation_mark_notifications, bp_notifications_mark_notifications_by_item_ids, BP_Notifications_Notification::update_id_list
Viewing 14 replies - 1 through 14 (of 14 total)

  • shanebp
    Moderator

    @shanebp

    You might ask on the support forums for bbPress.
    Or on the forums for GeneratePress.
    also – in general, using the BP Nouveau template pack is much preferable to using the BP Legacy template pack.


    Mike Witt
    Participant

    @mike80222

    @shanebp, OK I’ll ask bbP and GP.

    Just to be clear, are you saying that Legacy is not really supported anymore, or that it has problems? Or are you just saying you think Nouveau is nicer? I’ve got things looking just the way I want them with Legacy, and I don’t need any new features (on the site in question). So I wouldn’t have any reason to switch unless there are problems, or support is going away.

    Thanks,

    Mike


    shanebp
    Moderator

    @shanebp

    Legacy is still supported, but most if not all 3rd party plugins assume the use of Nouveau, especially if they also support BuddyBoss.
    And Nouveau is better in many aspects – but if you’re happy with Legacy…


    Mike Witt
    Participant

    @mike80222

    Ah, OK. So more potential conflicts with other plugins. I guess I’ll look at switching.


    Mike Witt
    Participant

    @mike80222

    @shanebp, I have a bit more information, and I wonder if you could possibly take another look?

    (1) I was wrong about the error being related to a bbPress closed topic. That turned out to be just a coincidence. It’s happened several more times now, and actually the times don’t line up with any posts or replies that I can find.

    (2) I’ve checked with bbPress and GeneratePress. Nobody can find any reason to think it’s related to bbP. GP tech support said that generatepress is in the error log only because the SQL request is being run inside the GP template, page.php, and GeneratePress doesn’t have any code that affects SQL requests. GP support believes that something called “bp_replace_the_content” is involved (for whatever that’s worth).

    (3) It’s only happened since I updated to BP 10.1.0, however I never updated to 10.0.0 so 10.1.0 was my first update to BP 10.

    (4) The update that gets the error is always:

    UPDATE wp_bp_notifications SET is_new = 0 WHERE item_id IN () AND user_id = 1492 AND component_name = ‘messages’ AND component_action = ‘new_message’

    (With different user_ids or course) I assume the problem it the empty IN (), right?

    (5) I haven’t been able to think of any way to attempt to reproduce the error.

    Any ideas at all would be much appreciated!

    Mike


    shanebp
    Moderator

    @shanebp

    Yes, the empty IN is the problem.
    Is the error thrown when you message another member?
    If not, then the issue is related to your theme or generatepress.


    Mike Witt
    Participant

    @mike80222

    I did manage to duplicate it by sending a couple of private messages back and forth between members. But it doesn’t happen every time. So I still haven’t found a sure-fire way to duplicate it. It doesn’t appear to happen exactly when the message is sent. Maybe when the notification is read? Strangely, in the case where I got the error, I can’t find any expected notifications missing. All the notifications appear to be intact. Both on the profile and in email.


    Mike Witt
    Participant

    @mike80222

    @shanebp – OK, I finally figured out how to replicate the error.

    Wordpress 5.9.2
    Twenty Twenty-Two Version: 1.1
    BuddyPress 10.2.0 (Nouveau)
    And some other plug-ins, including MemberPress and bbPress

    (1) Send two private messages to someone.
    (2) That person clicks on one of the notification, and the error happens
    Sometimes it happens if the recipient just refreshes their profile (and hence the notifications)

    Note: There need to be multiple private message notifications. If there’s just one notification the error doesn’t appear to happen.

    The error looks a bit different with BP Nouveau:

    [31-Mar-2022 17:41:07 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND user_id = 2 AND component_name = 'messages' AND component_action = 'new...' at line 1 for query UPDATE wp_bp_notifications SET is_new = 0 WHERE item_id IN () AND user_id = 2 AND component_name = 'messages' AND component_action = 'new_message' made by do_action('wp_ajax_messages_get_thread_messages'), WP_Hook->do_action, WP_Hook->apply_filters, bp_nouveau_ajax_get_thread_messages, bp_thread_the_message, BP_Messages_Thread_Template->the_message, do_action('thread_loop_start'), WP_Hook->do_action, WP_Hook->apply_filters, bp_messages_screen_conversation_mark_notifications, bp_notifications_mark_notifications_by_item_ids, BP_Notifications_Notification::update_id_list


    shanebp
    Moderator

    @shanebp

    The error is still the empty IN().
    You could try turning off other plugins and switching momentarily to a WP theme like 2020 – that may narrow down the error source.


    Mike Witt
    Participant

    @mike80222

    @shanebp

    > You could try turning off other plugins and switching momentarily to a WP theme like 2020

    Are you saying 2022 is no good?

    I’ll try turning other plugins off.


    Mike Witt
    Participant

    @mike80222

    @shanebp – OK, I deactivated every other plugin, and I switched from 2022 to 2020 as you suggested.

    Getting the same error when clicking on one of multiple PM notifications.

    The only things active are BuddyPress and the 2020 theme. No 2020 child.


    Mike Witt
    Participant

    @mike80222

    @shanebp – Just to summarize, I did everything you suggested, including 2020 and BP Nouveau. I still get the DB error. See comment above.


    shanebp
    Moderator

    @shanebp

    You could try opening a ticket. Reference this thread.


    Mike Witt
    Participant

    @mike80222

    OK. I’ve never created a track ticket before, so I hope I’ve done this right:
    https://buddypress.trac.wordpress.org/ticket/8676

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Skip to toolbar