• Resolved jtowell

    (@jtowell)


    Hi,
    I am encoutering the following errors in the fatal error log approximately every 5 minutes.
    This occurs even with all product feeds set to “No interval”

    Running the latest version ie 6.7.5 with WooCommerce 5.6.0 and WordPress 5.8.1

    CRITICAL Uncaught Error: Call to a member function get_image_id() on bool in /wp-content/plugins/best-woocommerce-feed/admin/class-rex-product-data-retriever.php:1995
    Stack trace:
    #0 /wp-content/plugins/best-woocommerce-feed/admin/class-rex-product-data-retriever.php(256): Rex_Product_Data_Retriever->set_image_att(‘main_image’)
    #1 /wp-content/plugins/best-woocommerce-feed/admin/class-rex-product-data-retriever.php(211): Rex_Product_Data_Retriever->set_val(Array)
    #2 /wp-content/plugins/best-woocommerce-feed/admin/class-rex-product-data-retriever.php(153): Rex_Product_Data_Retriever->set_all_value()
    #3 /wp-content/plugins/best-woocommerce-feed/admin/feed/abstract-rex-product-feed-generator.php(1171): Rex_Product_Data_Retriever->__construct(Object(WC_Product_Va in /wp-content/plugins/best-woocommerce-feed/admin/class-rex-product-data-retriever.php on line 1995

    It started on the 27th October and has been happening ever since. I have tried to deactivate and reactivate the plugin, but after 5 minutes it starts happening again, even though there are no feeds set to refresh.

    When the feeds are set to daily, it just gets stuck “Processing…” and doesn’t produce any feeds.

    If I go into individual feeds and “Update”, it generates a feed file correctly.

    Regards
    Janette

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter jtowell

    (@jtowell)

    Further information to my previous post, I have realised that the specific line of code that is causing the issue, is specific to WC_Product_Variation type products ie it is in an if that has just tested for this, and we have only Simple products no variable products. So I can’t understand how it is even reaching this line of code.

    Regards
    Janette

    Rafi Alam

    (@raficode)

    Hi,

    We are having a look at this issue and will get back to you.

    Thank you.

    Thread Starter jtowell

    (@jtowell)

    I have discovered that there is a rex cron running every 5 minutes. ie hook wp_rex_product_feed_background_process_cron running action Rex_Product_Feed_Background_Process->handle_cron_healthcheck() I am assuming this is what is causing the bug to be reported every 5 minutes. Would it be safe to delete this cron and see if it fixes the issue?

    We really need this fixed.

    Thanks
    Janette

    Thread Starter jtowell

    (@jtowell)

    Due to receving no assistance, I further looked into this issue, and for the benefit of someone in the future that may encounter the same issue here is what I have found out and done to fix the problem.

    1. In the plugin settings you can turn on logging, ie Product Feed –> Settings –> Control then toggle the “Enable log” to on.

    2. This then produces a log file in my case every 5 minutes when the health check background task runs. You can view the log file either through WooCommerce
    ie WooCommerce –> Status –> Logs and look for a log file name starting with “WPFM- ”
    or you can find the log file on the server in wp-content\uploads\wc-logs

    3. Looking at the last incomplete log entry this then gave me the product ID of when the error was occuring. It was for a product ID that didn’t exist in WooCommerce. How is this possible??? By looking for this ID in the wp_posts table where WooCommerce products are stored eg where 24803 is your product ID
    SELECT * FROM wp_posts where ID = 24803
    I was able to discover that a variable product (ie post_type product_variation) which had once existed and had been deleted from WooCommerce actually still existed in the wp_posts table. Now for the important part, the post_parent for this product didn’t exist in the wp_posts table. So this is an example of an orphaned variation. It was this ophaned variation that was causing the error.

    4. Orphaned variations occur when you delete a variations parent without first deleting the variation product. WooCommerce has a way to clean up orphaned variations ie go to WooCommerce –> Status –> Tools and “Delete orphaned variations”. The other way is to exclude variations from product feeds.

    5. In the process of all this I did also Clear the bathc and Purge the Cache in Product Feed –> Settings –> Control. I am unsure if this was absolutely necessary now but doing this at least got rid of the 5 minute health check cron job that had been causing the error to constantly be reported.

    In summary if you have any orphaned variation products in your system it will break all feeds. Maybe this is something that could be coded for in a future version of this plugin.

    I hope this is of some help to someone else.
    Janette

    Rafi Alam

    (@raficode)

    Hi,

    Sorry for the late reply as we were fully booked with the release of the new UI of the plugin.

    However, thank you so much for pointing the issue clearly, even better you showed how did you fix it!

    I will forward this to our dev team and they will analyze this and will take further steps.

    Again, thanks for letting us know.

    Regards.

    Hi,
    I just had a fatal error. WP actually said it was “WooCommerce Product Feed Manager WPML Support” I found this answer and took a chance on the WooCommerce –> Status –> Tools and “Delete orphaned variations” solution. It worked!
    I know that orphaned variations is a user/woocommerce issue but is there a way the plugin could be coded to avoid orphaned variations causing an error?

    My error however was different. I am not completely sure how variations related to it. I did nothing else but the suggested solution above and it worked. My error was

    An error of type E_PARSE was caused in line 26 of the file /nas/content/live/mysite/wp-content/plugins/wp-product-feed-manager-wpml/wp-product-feed-manager-wpml.php. Error message: syntax error, unexpected ‘{‘

    • This reply was modified 2 years, 10 months ago by mgason.
    • This reply was modified 2 years, 10 months ago by mgason.

    For your information I see this when I click the about “View details” link in the WP plugins list for WooCommerce Product Feed Manager
    backend view details dialog fail

    Hi @mgason ,

    Thanks for sharing the issue with us. We will look into this issue and take the necessary steps.

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘critical error call to a member function get_image_id() on bool’ is closed to new replies.