Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site keeps crashing with fatal error when jetpack activated #28654

Closed
ultra2extreme opened this issue Jan 30, 2023 · 5 comments
Closed

Site keeps crashing with fatal error when jetpack activated #28654

ultra2extreme opened this issue Jan 30, 2023 · 5 comments
Labels
[Package] Connection [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Type] Bug When a feature is broken and / or not performing as intended

Comments

@ultra2extreme
Copy link

ultra2extreme commented Jan 30, 2023

Hi all, this is the error and the Stack

Error Details

An error of type E_ERROR was caused in line 170 of the file /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php. Error message: Uncaught Error: Call to undefined function Automattic\Jetpack\wp_get_current_user() in /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php:170
Stack trace:
#0 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-content/plugins/jetpack/class.jetpack.php(2961): Automattic\Jetpack\Tracking->record_user_event()
#1 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-includes/class-wp-hook.php(308): Jetpack::plugin_deactivation()
#2 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#3 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-includes/plugin.php(517): WP_Hook->do_action()
#4 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/plugin.php(814): do_action()
#5 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/.inc(18): deactivate_plugins()
#6 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/plugin.php(2619): include_once('/home/vwf08ule8...')
#7 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/plugin.php(2619): {closure}()
#8 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-content/plugins/woocommerce-bulk-discount/woocommerce-bulk-discount.php(33): include_once('/home/vwf08ule8...')
#9 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-settings.php(447): include_once('/home/vwf08ule8...')
#10 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-config.php(111): require_once('/home/vwf08ule8...')
#11 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-load.php(50): require_once('/home/vwf08ule8...')
#12 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/admin.php(34): require_once('/home/vwf08ule8...')
#13 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/plugins.php(10): require_once('/home/vwf08ule8...')
#14 {main}
  thrown

keeps happening on one site im afraid i dont know why

@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Package] Connection labels Jan 31, 2023
@jeherve
Copy link
Member

jeherve commented Jan 31, 2023

That's an odd one. I'm not quite sure why wp_get_current_user() wouldn't be available at that point yet. Thanks for including the full backtrace.

Could you let me know the full list of plugins installed on that site, so I can try to reproduce on my end?

Also, is this happening when deactivating a specific plugin from the Plugins menu?

@anomiex
Copy link
Contributor

anomiex commented Jan 31, 2023

That's an odd one. I'm not quite sure why wp_get_current_user() wouldn't be available at that point yet.

That part is easy enough to explain: the function is defined in wp-includes/pluggable.php, which isn't loaded until after plugins are loaded. The stack trace is happening during the load of the WooCommerce Bulk Discount plugin.

Where I get lost looking at this trace is here:

#5 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/.inc(18): deactivate_plugins()
#6 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/plugin.php(2619): include_once('/home/vwf08ule8...')
#7 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/plugin.php(2619): {closure}()

Which version of WordPress is being used here? Do you have custom modifications to these files?

@ultra2extreme
Copy link
Author

That's an odd one. I'm not quite sure why wp_get_current_user() wouldn't be available at that point yet.

That part is easy enough to explain: the function is defined in wp-includes/pluggable.php, which isn't loaded until after plugins are loaded. The stack trace is happening during the load of the WooCommerce Bulk Discount plugin.

Where I get lost looking at this trace is here:

#5 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/.inc(18): deactivate_plugins()
#6 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/plugin.php(2619): include_once('/home/vwf08ule8...')
#7 /home/vwf08ule8jdp/public_html/radicalsupplements.com/wp-admin/includes/plugin.php(2619): {closure}()

Which version of WordPress is being used here? Do you have custom modifications to these files?

Thanks for your reply Anomix, its 6.1.1 and nothing custom going on as you can tell im not much of a web developer, i simply installed wordpress, elementor, woo commerce and a few other plugins and made a quick site. Its probable that a clean FTP upload of WP files will fix but i really wanted to get to the bottom of why its happening as its about the 5th time this year

@anomiex
Copy link
Contributor

anomiex commented Feb 1, 2023

Thanks for the info, knowing the version of WordPress in use helps.

The stack trace shows execution at line 2619 of wp-admin/includes/plugin.php, but when I look in the WordPress source for 6.1.1, that file only has 2588 lines. Then the trace also shows execution in a file named wp-admin/includes/.inc, which doesn't exist at all in the WordPress source.

While I can only guess without seeing the code in those files, it seems like that added code is trying to deactivate the Jetpack plugin if it finds it enabled, and only happens to raise an error because that WooCommerce Bulk Discount plugin happens to be causing the code to run too early during WordPress's initialization.

@jeherve
Copy link
Member

jeherve commented Mar 20, 2023

Closing this for now because of the lack of activity on this. We can always reopen in the future if needed.

@jeherve jeherve closed this as completed Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Connection [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

No branches or pull requests

3 participants