Fatal Errors Occur while Running XStore on php 8.0 – Is this a known issue??

This topic has 11 replies, 2 voices, and was last updated 1 years, 10 months ago ago by Rose Tyler

  • Avatar: bnourse
    bnourse
    Participant
    September 17, 2022 at 22:46

    Hello,

    We are having repeated fatal errors on our site when we activate php v8.0. A couple of examples are included below.

    Because our site is live, we are unable to deactivate plugins to test, and can’t discover directly how to trigger the error. But, we do know if we roll back to php v7.4, the errors do not occur.

    Can you recognize from the stack trace what might be causing this, and is this a known issue???

    Is Xstore theme tested against php v8.0???

    Your assistance would be greatly appreciated!

    Ben

    2022-09-17T02:53:47+00:00 CRITICAL Uncaught TypeError: strstr(): Argument #1 ($haystack) must be of type string, WP_Error given in /nas/content/live/borregooutfitt/wp-includes/functions.php:1143
    Stack trace:
    #0 /nas/content/live/borregooutfitt/wp-includes/functions.php(1143): strstr(Object(WP_Error), ‘#’)
    #1 /nas/content/live/borregooutfitt/wp-includes/functions.php(1212): add_query_arg(‘view_mode’, false, Object(WP_Error))
    #2 /nas/content/live/borregooutfitt/wp-content/themes/xstore/framework/woo.php(2423): remove_query_arg(‘view_mode’, Object(WP_Error))
    #3 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(307): etheme_grid_list_switcher(”)
    #4 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #5 /nas/content/live/borregooutfitt/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #6 /nas/content/live/borregooutfitt/wp-content/themes/xstore/woocommerce/archive-product.php(89): do_action(‘woocommerce_bef…’)
    #7 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include(‘/nas/content/li…’)
    #8 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/templates/taxonomy-product-cat.php(22): wc_get_template(‘archive-product…’)
    #9 /nas/content/live/borregooutfitt/wp-includes/template-loader.php(106): include(‘/nas/content/li…’)
    #10 /nas/content/live/borregooutfitt/wp-blog-header.php(19): require_once(‘/nas/content/li…’)
    #11 /nas/content/live/borregooutfitt/index.php(17): require(‘/nas/content/li…’)
    #12 {main}
    thrown in /nas/content/live/borregooutfitt/wp-includes/functions.php on line 1143

    2022-09-17T03:48:32+00:00 CRITICAL Uncaught TypeError: strstr(): Argument #1 ($haystack) must be of type string, WP_Error given in /nas/content/live/borregooutfitt/wp-includes/functions.php:1143
    Stack trace:
    #0 /nas/content/live/borregooutfitt/wp-includes/functions.php(1143): strstr(Object(WP_Error), ‘#’)
    #1 /nas/content/live/borregooutfitt/wp-includes/functions.php(1212): add_query_arg(‘view_mode’, false, Object(WP_Error))
    #2 /nas/content/live/borregooutfitt/wp-content/themes/xstore/framework/woo.php(2423): remove_query_arg(‘view_mode’, Object(WP_Error))
    #3 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(307): etheme_grid_list_switcher(”)
    #4 /nas/content/live/borregooutfitt/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #5 /nas/content/live/borregooutfitt/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #6 /nas/content/live/borregooutfitt/wp-content/themes/xstore/woocommerce/archive-product.php(89): do_action(‘woocommerce_bef…’)
    #7 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include(‘/nas/content/li…’)
    #8 /nas/content/live/borregooutfitt/wp-content/plugins/woocommerce/templates/taxonomy-product-cat.php(22): wc_get_template(‘archive-product…’)
    #9 /nas/content/live/borregooutfitt/wp-includes/template-loader.php(106): include(‘/nas/content/li…’)
    #10 /nas/content/live/borregooutfitt/wp-blog-header.php(19): require_once(‘/nas/content/li…’)
    #11 /nas/content/live/borregooutfitt/index.php(17): require(‘/nas/content/li…’)
    #12 {main}
    thrown in /nas/content/live/borregooutfitt/wp-includes/functions.php on line 1143

    10 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 19, 2022 at 12:53

    Hello,

    Provide URL of the page with the error + temporary wp-admin and FTP access.

    Regards

    Avatar: bnourse
    bnourse
    Participant
    September 19, 2022 at 13:13

    Hello Rose,
    Credentials provided in private area.
    Unfortunately, I cannot provide a particular URL on the site which causes this error to occur. It seems to occur somewhat at random. If you look at our error log, you can see these errors are occurring multiple times over a 12 hour period.
    If we revert back to php 7.4, then the site runs error free.
    I thought that by looking at the error stack trace, you might recognize where the error is coming from.
    Please advise.
    Thank you for your assistance.
    Ben

    Please contact administrator
    for this information.
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 19, 2022 at 13:17

    Hello @Bnourse,

    Thank you for the fast reply.
    Please check FTP access, because we can’t connect. What post should we use? Is there a restriction by ip or something else?

    Regards

    Avatar: bnourse
    bnourse
    Participant
    September 19, 2022 at 13:25

    I’m sorry, see private area for port number.
    I just connected without problem, shouldn’t be any restrictions.
    Let me know if still having problem connecting.

    Please contact administrator
    for this information.
    Avatar: bnourse
    bnourse
    Participant
    September 19, 2022 at 16:34

    I notice you added code to the child theme functions.php.
    I had moved that code to snippets plugin, but I have turned that snippet off for the time being while you test.
    Ben

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 19, 2022 at 16:43

    Your child-theme looks a bit miconfigured -> https://prnt.sc/UZ_mojr3Un4v
    We corrected it for you and added few lines fix which may help in your case -> https://prnt.sc/yyKRmqzLXnaw

    Please, check for some time if the issue still persists

    Regards

    Avatar: bnourse
    bnourse
    Participant
    September 19, 2022 at 16:57

    As I said, I had moved that code from the child theme to a snippet. But, that snippet is now deactivated and I will leave the child theme as you have it.

    I will watch to see if the errors continue, and will let you know.

    Wondering about the additional code, doesn’t it just redirect to the homepage if an error occurs?

    Thanks for helping.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 20, 2022 at 08:09

    Ok, we got you !
    ‘Wondering about the additional code, doesn’t it just redirect to the homepage if an error occurs?’ = yes, but we don’t know exactly when the issue starts so it requires some time to understand when it is and where. if you will have any ready results of testing/checking, write us and we will dig deeper inside the problem with provided details from your side.

    Regards

    Avatar: bnourse
    bnourse
    Participant
    September 20, 2022 at 12:38

    Good morning,
    I can report that with the redirect code in place, the fatal errors are not appearing in the log…
    Wondering if that redirect snippet could be changed to actually report the URL where the errors occur in a log???
    Thank you for helping track this down. We are really wanting to run the site on php 8.0, and our hosting provider wpengine is encouraging this, since they may discontinue php 7.4 support sometime soon.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    September 21, 2022 at 08:59

    Hello,

    It is nice to hear that our tweak helped you in your specific case.
    ‘Wondering if that redirect snippet could be changed to actually report the URL where the errors occur in a log???’ = no it is not possible, but you may remove it and check again = it will show you errors which you had in the first message you described but without any details more. You may also try to remove the snippet and check one by one plugins you have.

    Truly saying that error shows randomly so you will not be able to find the real reason (or real plugin which created such thing) quickly.

    We would recommend you to keep that snippet enabled because it won’t make any issues for you but only helps in some cases which cannot be found.

    Regards

  • Viewing 11 results - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.