• Resolved Khaled Alkhamesi

    (@khaledalkhamesi)


    wordpress: 6.6.2

    woocommerce: 9.3.1

    PHP: 8.1.29

    MariaDB: 10.6

    [16-Sep-2024 09:42:48 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 ')
    GROUP BY terms.term_id' at line 9 for query SELECT COUNT( DISTINCT wp_posts.ID ) as term_count, terms.term_id as term_count_id FROM wp_posts
    INNER JOIN wp_term_relationships AS term_relationships ON wp_posts.ID = term_relationships.object_id
    INNER JOIN wp_term_taxonomy AS term_taxonomy USING( term_taxonomy_id )
    INNER JOIN wp_terms AS terms USING( term_id )

    WHERE wp_posts.post_type IN ( 'product' )
    AND wp_posts.post_status = 'publish'

    AND terms.term_id IN ()
    GROUP BY terms.term_id made by require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WC_REST_Product_Attributes_V1_Controller->get_items, WC_REST_Product_Attributes_V1_Controller->prepare_item_for_response, apply_filters('woocommerce_rest_prepare_product_attribute'), WP_Hook->apply_filters, flutter_custom_change_product_attribute, get_filtered_term_product_counts

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @khaledalkhamesi,

    Thank you for reaching out. I understand you’re getting a database error with the attached query. Can you please share a bit more details about this issue so we can learn more and help you troubleshoot it? For instance:

    • Which page were you viewing, or which action were you trying to do when you got this error? Can you share the exact steps to take to try to replicate this?
    • Do you find any errors on your WooCommerce > Status > Logs? If so, please share them with us over https://gist.github.com/.

    Thanks!
    -OP

    Thread Starter Khaled Alkhamesi

    (@khaledalkhamesi)

    Thank you for your reply.

    Actually I don’t know when the problem appeared, I recently noticed an increase in bandwidth consumption and loads, although the site is new and has only 10-20 visitors, last month it consumed 700 GB of bandwidth, while in the past months it only consumed 30 GB.

    I am not a programming expert, but someone advised me to look at the error log in the logs folder in the cPanel control panel, and when I told him about what I found, he advised me to write to you here.

    No programming errors appear on the site interface or on the application associated with it flexbuillder.

    I only found these errors in the username_com.php.error.log file in the Logs folder.

    I hope to find a solution.

    Thank you.

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @khaledalkhamesi,

    Actually I don’t know when the problem appeared, I recently noticed an increase in bandwidth consumption and loads, although the site is new and has only 10-20 visitors, last month it consumed 700 GB of bandwidth, while in the past months it only consumed 30 GB.

    Thank you for the additional details. I understand your main concern is an increase in bandwidth consumption. The 700GB bandwidth consumption is a lot, especially for a new, low-traffic/new website. Have you reached out to your hosting support to learn more about this? They should be able to share more insights about it.

    I am not a programming expert, but someone advised me to look at the error log in the logs folder in the cPanel control panel, and when I told him about what I found, he advised me to write to you here.

    No programming errors appear on the site interface or on the application associated with it flexbuillder.

    I only found these errors in the username_com.php.error.log file in the Logs folder.

    How often does this error show up in your logs? Did you find any additional details in the WooCommerce logs? Regarding the query error, you mention it comes from Flexbuilder. Can you share a link to this product, please? Did you try disabling it to see if the issue stops?

    Thanks!
    -OP

    Thread Starter Khaled Alkhamesi

    (@khaledalkhamesi)

    I have disabled the plugins but the problem still persists, when I disconnect the site from the database the consumption stops completely. It seems that there is something that is querying the database in the background in a big way that is causing this load.

    Thread Starter Khaled Alkhamesi

    (@khaledalkhamesi)

    i have wp_woocommerce_sessions table database 800 MB , it is not normal correct?

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello Khaled Alkhamesi,

    Thank you for your reply.

    It sounds like the issue may be related to WooCommerce sessions.
    An 800 MB wp_woocommerce_sessions table is indeed abnormal for a site with low traffic.

    I suggest you clear customer sessions by going to WooCommerce > Status > Tools and clicking “Clear customer sessions.” After this, check the size of the wp_woocommerce_sessions table.

    These sessions should be cleared automatically.
    Could you check for any failed or pending actions under WooCommerce > Status > Scheduled Actions?

    About your initial issue, site consumed 700 GB of bandwidth.
    Bandwidth consumption refers to the amount of data transferred between a website and visitors over a specific period. High bandwidth consumption can be caused by large files (like images or videos) or even unusual activity like bots or spam traffic. It would be helpful to contact your host and determine the cause of high bandwidth consumption.

    Please let me know about your findings.

    Best regards.

    Thread Starter Khaled Alkhamesi

    (@khaledalkhamesi)

    Thanks for your reply.

    Indeed I went to the scheduled actions and found (344) failed operations All operations without exception are for the following processes:
    wc_run_batch_process
    Proofs:
    0 => ‘Automattic\WooCommerce\Internal\DataStores\Orders\DataSynchronizer’

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello Khaled Alkhamesi,

    Thank you for your reply

    To delve deeper into this issue, I recommend installing the WP Crontrol plugin.
    This plugin will provide you with additional information regarding the failed actions and will also indicate if there are any problems with the WPCron.

    Please keep me updated on what you discover.
    It would be beneficial if you could share screenshots as well.

    Best regards.

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