google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 291 forks source link

report must be an array to partition. #5517

Closed jamesozzie closed 2 years ago

jamesozzie commented 2 years ago

Bug Description

A few users in the support forums have encountered a "report must be an array to partition." error on the Site Kit dashboard.

image

Until today we've so far been unable to recreate this or pinpoint the exact cause. Today, when recreating an environment of one impacted user (SH info) we were able to recreate this in support. In this particular case it occured after activating one of the same plugins as the impacted user.

Gathering more details at present, issue details to be updated. Trying to recreate on other sites at present

Console errors on a support site where this appears: ``` checkPropTypes.js?a15c:20 Warning: Failed prop type: Invalid prop `report` of type `object` supplied to `UserCountGraph`, expected an array. in UserCountGraph (created by DashboardAllTrafficWidget) in DashboardAllTrafficWidget (created by WhenAnalyticsActive(DashboardAllTrafficWidget)) in WhenAnalyticsActive(DashboardAllTrafficWidget) (created by WidgetRenderer) in WidgetRenderer (created by WidgetAreaRenderer) in div (created by Cell) in Cell (created by WidgetCellWrapper) in WidgetCellWrapper (created by WidgetAreaRenderer) in div (created by Row) in Row (created by WidgetAreaRenderer) in div (created by WidgetAreaRenderer) in div (created by ForwardRef) in ForwardRef (created by WidgetAreaRenderer) in WidgetAreaRenderer (created by WidgetContextRenderer) in div (created by WidgetContextRenderer) in WidgetContextRenderer (created by DashboardMainApp) in DashboardMainApp (created by DashboardEntryPoint) in DashboardEntryPoint in RestoreSnapshots (created by Root) in ErrorHandler (created by Root) in StrictMode (created by Root) in Root printWarning @ checkPropTypes.js?a15c:20 checkPropTypes.js?a15c:20 Warning: Failed prop type: Invalid prop `report` of type `object` supplied to `UserDimensionsPieChart`, expected an array. in UserDimensionsPieChart (created by DashboardAllTrafficWidget) in DashboardAllTrafficWidget (created by WhenAnalyticsActive(DashboardAllTrafficWidget)) in WhenAnalyticsActive(DashboardAllTrafficWidget) (created by WidgetRenderer) in WidgetRenderer (created by WidgetAreaRenderer) in div (created by Cell) in Cell (created by WidgetCellWrapper) in WidgetCellWrapper (created by WidgetAreaRenderer) in div (created by Row) in Row (created by WidgetAreaRenderer) in div (created by WidgetAreaRenderer) in div (created by ForwardRef) in ForwardRef (created by WidgetAreaRenderer) in WidgetAreaRenderer (created by WidgetContextRenderer) in div (created by WidgetContextRenderer) in WidgetContextRenderer (created by DashboardMainApp) in DashboardMainApp (created by DashboardEntryPoint) in DashboardEntryPoint in RestoreSnapshots (created by Root) in ErrorHandler (created by Root) in StrictMode (created by Root) in Root printWarning @ checkPropTypes.js?a15c:20 checkPropTypes.js?a15c:20 Warning: Failed prop type: Invalid prop `report` of type `object` supplied to `TotalUserCount`, expected an array. in TotalUserCount (created by DashboardAllTrafficWidget) in DashboardAllTrafficWidget (created by WhenAnalyticsActive(DashboardAllTrafficWidget)) in WhenAnalyticsActive(DashboardAllTrafficWidget) (created by WidgetRenderer) in WidgetRenderer (created by WidgetAreaRenderer) in div (created by Cell) in Cell (created by WidgetCellWrapper) in WidgetCellWrapper (created by WidgetAreaRenderer) in div (created by Row) in Row (created by WidgetAreaRenderer) in div (created by WidgetAreaRenderer) in div (created by ForwardRef) in ForwardRef (created by WidgetAreaRenderer) in WidgetAreaRenderer (created by WidgetContextRenderer) in div (created by WidgetContextRenderer) in WidgetContextRenderer (created by DashboardMainApp) in DashboardMainApp (created by DashboardEntryPoint) in DashboardEntryPoint in RestoreSnapshots (created by Root) in ErrorHandler (created by Root) in StrictMode (created by Root) in Root printWarning @ checkPropTypes.js?a15c:20 checkPropTypes.js?a15c:20 Warning: Failed prop type: Invalid prop `searchConsoleData` of type `object` supplied to `Overview`, expected an array. in Overview (created by SearchFunnelWidget) in SearchFunnelWidget (created by WidgetRenderer) in WidgetRenderer (created by WidgetAreaRenderer) in div (created by Cell) in Cell (created by WidgetCellWrapper) in WidgetCellWrapper (created by WidgetAreaRenderer) in div (created by Row) in Row (created by WidgetAreaRenderer) in div (created by WidgetAreaRenderer) in div (created by ForwardRef) in ForwardRef (created by WidgetAreaRenderer) in WidgetAreaRenderer (created by WidgetContextRenderer) in div (created by WidgetContextRenderer) in WidgetContextRenderer (created by DashboardMainApp) in DashboardMainApp (created by DashboardEntryPoint) in DashboardEntryPoint in RestoreSnapshots (created by Root) in ErrorHandler (created by Root) in StrictMode (created by Root) in Root printWarning @ checkPropTypes.js?a15c:20 checkPropTypes.js?a15c:20 Warning: Failed prop type: Invalid prop `data` of type `object` supplied to `SearchConsoleStats`, expected an array. in SearchConsoleStats (created by SearchFunnelWidget) in SearchFunnelWidget (created by WidgetRenderer) in WidgetRenderer (created by WidgetAreaRenderer) in div (created by Cell) in Cell (created by WidgetCellWrapper) in WidgetCellWrapper (created by WidgetAreaRenderer) in div (created by Row) in Row (created by WidgetAreaRenderer) in div (created by WidgetAreaRenderer) in div (created by ForwardRef) in ForwardRef (created by WidgetAreaRenderer) in WidgetAreaRenderer (created by WidgetContextRenderer) in div (created by WidgetContextRenderer) in WidgetContextRenderer (created by DashboardMainApp) in DashboardMainApp (created by DashboardEntryPoint) in DashboardEntryPoint in RestoreSnapshots (created by Root) in ErrorHandler (created by Root) in StrictMode (created by Root) in Root printWarning @ checkPropTypes.js?a15c:20 browser.js?40b6:45 Uncaught Invariant Violation: report must be an array to partition. at invariant (webpack-internal:///./node_modules/invariant/browser.js:38:15) at partitionReport (webpack-internal:///./assets/js/util/partition-report.js:41:51) at extractSearchConsoleDashboardData (webpack-internal:///./assets/js/modules/search-console/util/index.js:98:104) at Overview (webpack-internal:///./assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/Overview.js:163:110) at renderWithHooks (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16260:18) at mountIndeterminateComponent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18794:13) at beginWork$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:20162:16) at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:336:14) at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:385:16) at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:440:31) browser.js?40b6:45 Uncaught Invariant Violation: report must be an array to partition. at invariant (webpack-internal:///./node_modules/invariant/browser.js:38:15) at partitionReport (webpack-internal:///./assets/js/util/partition-report.js:41:51) at SearchConsoleStats (webpack-internal:///./assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/SearchConsoleStats.js:66:104) at renderWithHooks (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16260:18) at mountIndeterminateComponent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18794:13) at beginWork$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:20162:16) at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:336:14) at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:385:16) at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:440:31) at beginWork$$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:25780:7) react-dom.development.js?61bb:21843 The above error occurred in the component: in Overview (created by SearchFunnelWidget) in div (created by Widget) in div (created by Widget) in Widget (created by WithWidgetSlug(Widget)) in WithWidgetSlug(Widget) (created by SearchFunnelWidget) in SearchFunnelWidget (created by WidgetRenderer) in WidgetRenderer (created by WidgetAreaRenderer) in div (created by Cell) in Cell (created by WidgetCellWrapper) in WidgetCellWrapper (created by WidgetAreaRenderer) in div (created by Row) in Row (created by WidgetAreaRenderer) in div (created by WidgetAreaRenderer) in div (created by ForwardRef) in ForwardRef (created by WidgetAreaRenderer) in WidgetAreaRenderer (created by WidgetContextRenderer) in div (created by WidgetContextRenderer) in WidgetContextRenderer (created by DashboardMainApp) in DashboardMainApp (created by DashboardEntryPoint) in DashboardEntryPoint in RestoreSnapshots (created by Root) in ErrorHandler (created by Root) in StrictMode (created by Root) in Root React will try to recreate this component tree from scratch using the error boundary you provided, ErrorHandler. logCapturedError @ react-dom.development.js?61bb:21843 index.js?68d0:55 Caught an error: Invariant Violation: report must be an array to partition. at invariant (webpack-internal:///./node_modules/invariant/browser.js:38:15) at partitionReport (webpack-internal:///./assets/js/util/partition-report.js:41:51) at extractSearchConsoleDashboardData (webpack-internal:///./assets/js/modules/search-console/util/index.js:98:104) at Overview (webpack-internal:///./assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/Overview.js:163:110) at renderWithHooks (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16260:18) at mountIndeterminateComponent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18794:13) at beginWork$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:20162:16) at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:336:14) at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:385:16) at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:440:31) Object componentDidCatch @ index.js?68d0:55 react-dom.development.js?61bb:21843 The above error occurred in the component: in SearchConsoleStats (created by SearchFunnelWidget) in div (created by Widget) in div (created by Widget) in Widget (created by WithWidgetSlug(Widget)) in WithWidgetSlug(Widget) (created by SearchFunnelWidget) in SearchFunnelWidget (created by WidgetRenderer) in WidgetRenderer (created by WidgetAreaRenderer) in div (created by Cell) in Cell (created by WidgetCellWrapper) in WidgetCellWrapper (created by WidgetAreaRenderer) in div (created by Row) in Row (created by WidgetAreaRenderer) in div (created by WidgetAreaRenderer) in div (created by ForwardRef) in ForwardRef (created by WidgetAreaRenderer) in WidgetAreaRenderer (created by WidgetContextRenderer) in div (created by WidgetContextRenderer) in WidgetContextRenderer (created by DashboardMainApp) in DashboardMainApp (created by DashboardEntryPoint) in DashboardEntryPoint in RestoreSnapshots (created by Root) in ErrorHandler (created by Root) in StrictMode (created by Root) in Root React will try to recreate this component tree from scratch using the error boundary you provided, ErrorHandler. logCapturedError @ react-dom.development.js?61bb:21843 index.js?68d0:55 Caught an error: Invariant Violation: report must be an array to partition. at invariant (webpack-internal:///./node_modules/invariant/browser.js:38:15) at partitionReport (webpack-internal:///./assets/js/util/partition-report.js:41:51) at SearchConsoleStats (webpack-internal:///./assets/js/modules/search-console/components/dashboard/SearchFunnelWidget/SearchConsoleStats.js:66:104) at renderWithHooks (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:16260:18) at mountIndeterminateComponent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18794:13) at beginWork$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:20162:16) at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:336:14) at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:385:16) at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:440:31) at beginWork$$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:25780:7) Object componentDidCatch @ index.js?68d0:55 2create-notifications-store.js?1360:81 Uncaught (in promise) TypeError: notifications.reduce is not a function at reducerCallback (create-notifications-store.js?1360:81:1) at reducer (create-fetch-store.js?6e06:240:1) at eval (utils.js?7a06:110:1) at Array.reduce () at eval (utils.js?7a06:109:1) at eval (utils.js?7a06:110:1) at Array.reduce () at eval (utils.js?7a06:109:1) at eval (utils.js?7a06:110:1) at Array.reduce () /wp-admin/admin.php?page=googlesitekit-dashboard#traffic:1 Error handling response: TypeError: self.processResponse is not a function at chrome-extension://cmkdbmfndkfgebldhnkbfhlneefdaaip/js/notification.js:154:10 /wp-admin/admin-ajax.php:1 Failed to load resource: net::ERR_CONNECTION_TIMED_OUT detector.js:1 Failed to load resource: net::ERR_NETWORK_CHANGED ```

Steps to reproduce

  1. Setup SK on a new clean WP install (Only SK active). No need to include Analytics during set up
  2. Install and activate the JWT Auth plugin
  3. Revisit the Site Kit dashboard. If the error doesn't appear change the reporting period. (I had tested this yesterday although I didn't encounter the same, until I changed the reporting period)

Screenshots

https://user-images.githubusercontent.com/41326532/177720076-05cbb102-d7b4-49f1-87c8-449166f3f8ec.mp4

Impacted Users

Additional Context


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

jamesozzie commented 2 years ago

Update: From reviewing the JWT Auth plugin I can consistently recreate this, following the steps below:

  1. Setup SK on a new clean WP install (Only SK active). No need to include Analytics during set up
  2. Install and activate the JWT Auth plugin
  3. Revisit the Site Kit dashboard. If the error doesn't appear change the reporting period. (I had tested this yesterday although I didn't encounter the same, until I changed the reporting period)

The error remains after deactivating JWT Auth plugin, until your session storage is cleared.

image

Before escalating or adding further details I'm going to try and recreate this same error based on the latest report of this error, where the JWT Auth plugin is not active.

jamesozzie commented 2 years ago

Unable to recreate the same issue without the JWT Auth plugin inactive, as per one users experience. This user did however encounter a separate error within their Site Health dashboard.

The other 2 Site Health info reports we have do indicate a JWT Auth plugin active, indicating there is a conflict of some type.

jamesozzie commented 2 years ago

Escalating this for team review, with no obvious cause. Notes added to main bug description. Unsure if there is anything that can be done on the Site Kit side with this conflict.

Note that I also have a test site in support with all the same plugins as the sole impacted user who reported this who doesn't have the JWT Auth plugin active. I can't recreate the same error on this site, indicating the conflict is only with the JWT Plugin.

jamesozzie commented 2 years ago

One additional user in the forums reported the same. Details added to main body of report above.

This user confirmed that this error appears with the JWT plugin active.

jamesozzie commented 2 years ago

I've been doing more testing on this today, and it occurs consistently on one site, while not evident on another. Additional notes:

https://user-images.githubusercontent.com/41326532/181570918-27de6e12-7997-4d7f-8841-44ce7d10e545.mp4

SH info where this does't occur ``` ### wp-core ### version: 6.0.1 site_language: en_US user_language: en_US timezone: +00:00 permalink: undefined https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: 1 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /var/www/vhosts/xyko.org/httpdocs wordpress_size: loading... uploads_path: /var/www/vhosts/xyko.org/httpdocs/wp-content/uploads uploads_size: loading... themes_path: /var/www/vhosts/xyko.org/httpdocs/wp-content/themes themes_size: loading... plugins_path: /var/www/vhosts/xyko.org/httpdocs/wp-content/plugins plugins_size: loading... database_size: loading... total_size: loading... ### wp-dropins (1) ### maintenance.php: true ### wp-active-theme ### name: Twenty Twenty-Two (twentytwentytwo) version: 1.2 author: the WordPress team author_website: https://wordpress.org/ parent_theme: none theme_features: core-block-patterns, post-thumbnails, responsive-embeds, editor-styles, html5, automatic-feed-links, block-templates, widgets-block-editor, wp-block-styles, editor-style theme_path: /var/www/vhosts/xyko.org/httpdocs/wp-content/themes/twentytwentytwo auto_update: Disabled ### wp-themes-inactive (2) ### Twenty Twenty: version: 1.9, author: the WordPress team (latest version: 2.0), Auto-updates disabled Twenty Twenty-One: version: 1.5, author: the WordPress team (latest version: 1.6), Auto-updates disabled ### wp-plugins-active (2) ### JWT Auth: version: 2.1.0, author: Useful Team, Auto-updates disabled Site Kit by Google: version: 1.79.1, author: Google, Auto-updates disabled ### wp-plugins-inactive (2) ### Akismet Anti-Spam: version: 4.2.2, author: Automattic (latest version: 5.0), Auto-updates disabled Hello Dolly: version: 1.7.2, author: Matt Mullenweg, Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1690 imagemagick_version: ImageMagick 6.9.10-68 Q16 x86_64 2021-10-14 https://imagemagick.org imagick_version: 3.7.0 file_uploads: File uploads is turned off post_max_size: 8M upload_max_filesize: 128M max_effective_size: 8 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 11 GB imagick::RESOURCETYPE_DISK: 9.2233720368548E+18 imagick::RESOURCETYPE_FILE: 1536 imagick::RESOURCETYPE_MAP: 11 GB imagick::RESOURCETYPE_MEMORY: 6 GB imagick::RESOURCETYPE_THREAD: 1 imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV gd_version: bundled (2.1.0 compatible) gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: 9.25 ### wp-server ### server_architecture: Linux 3.10.0-957.5.1.el7.x86_64 x86_64 httpd_software: Apache php_version: 8.0.20 64bit php_sapi: cgi-fcgi max_input_variables: 1000 time_limit: 60 memory_limit: 128M admin_memory_limit: 256M max_input_time: 60 upload_max_filesize: 128M php_post_max_size: 8M curl_version: 7.29.0 NSS/3.53.1 suhosin: false imagick_availability: true pretty_permalinks: true ### wp-database ### extension: mysqli server_version: 5.5.68-MariaDB client_version: mysqlnd 8.0.20 max_allowed_packet: 1048576 max_connections: 151 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /var/www/vhosts/xyko.org/httpdocs/wp-content WP_PLUGIN_DIR: /var/www/vhosts/xyko.org/httpdocs/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: Undefined DB_CHARSET: utf8 DB_COLLATE: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable ### google-site-kit ### version: 1.79.1 php_version: 8.0.20 wp_version: 6.0.1 reference_url: https://xyko.org amp_mode: no site_status: connected-site user_status: authenticated verification_status: verified-non-site-kit connected_user_count: 1 active_modules: site-verification, search-console, analytics, analytics-4, pagespeed-insights recoverable_modules: none required_scopes: openid: ✅ https://www.googleapis.com/auth/userinfo.profile: ✅ https://www.googleapis.com/auth/userinfo.email: ✅ https://www.googleapis.com/auth/siteverification: ✅ https://www.googleapis.com/auth/webmasters: ✅ https://www.googleapis.com/auth/analytics.readonly: ✅ capabilities: googlesitekit_authenticate: ✅ googlesitekit_setup: ✅ googlesitekit_view_posts_insights: ✅ googlesitekit_view_dashboard: ✅ googlesitekit_manage_options: ✅ googlesitekit_view_splash: ✅ googlesitekit_view_authenticated_dashboard: ✅ googlesitekit_view_wp_dashboard_widget: ✅ googlesitekit_view_admin_bar_menu: ✅ enabled_features: adsenseSetupV2: ⭕ dashboardSharing: ⭕ ga4ActivationBanner: ⭕ ideaHubModule: ⭕ twgModule: ⭕ userInput: ⭕ zeroDataStates: ✅ search_console_property: https://xyko.org/ analytics_account_id: 1773••••• analytics_property_id: UA-1773••••••• analytics_profile_id: 2283••••• analytics_use_snippet: yes analytics_4_property_id: 2765637•• analytics_4_web_data_stream_id: 3531•••••• analytics_4_measurement_id: G-1D•••••••• analytics_4_use_snippet: yes ```
SH info where this does occur - TasteWP site ``` ### wp-core ### version: 6.0.1 site_language: en_US user_language: en_US timezone: +00:00 permalink: /%year%/%monthnum%/%day%/%postname%/ https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: -1 dotorg_communication: true ### wp-paths-sizes ### wordpress_path: /s4-lastprison/wordpress wordpress_size: loading... uploads_path: /s4-lastprison/wordpress/wp-content/uploads uploads_size: loading... themes_path: /s4-lastprison/wordpress/wp-content/themes themes_size: loading... plugins_path: /s4-lastprison/wordpress/wp-content/plugins plugins_size: loading... database_size: loading... total_size: loading... ### wp-dropins (1) ### maintenance.php: true ### wp-active-theme ### name: Twenty Twenty (twentytwenty) version: 2.0 author: the WordPress team author_website: https://wordpress.org/ parent_theme: none theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, custom-background, post-thumbnails, custom-logo, title-tag, html5, align-wide, responsive-embeds, customize-selective-refresh-widgets, editor-color-palette, editor-font-sizes, editor-styles, widgets, menus, editor-style theme_path: /s4-lastprison/wordpress/wp-content/themes/twentytwenty auto_update: Disabled ### wp-plugins-active (2) ### JWT Auth: version: 2.1.0, author: Useful Team, Auto-updates disabled Site Kit by Google: version: 1.79.1, author: Google, Auto-updates disabled ### wp-plugins-inactive (4) ### Backup Migration: version: 1.2.1, author: Migrate, Auto-updates enabled Copy & Delete Posts: version: 1.3.0, author: Copy Delete Posts, Auto-updates enabled MyPopUps: version: 1.1.1, author: Pop-ups, Auto-updates enabled Redirect Redirection: version: 1.0.9, author: Inisev, Auto-updates disabled ### wp-media ### image_editor: WP_Image_Editor_Imagick imagick_module_version: 1690 imagemagick_version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org imagick_version: 3.6.0 file_uploads: File uploads is turned off post_max_size: 60M upload_max_filesize: 60M max_effective_size: 60 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 122 MB imagick::RESOURCETYPE_DISK: 1.073742E+9 imagick::RESOURCETYPE_FILE: 192492 imagick::RESOURCETYPE_MAP: 512 MB imagick::RESOURCETYPE_MEMORY: 256 MB imagick::RESOURCETYPE_THREAD: 1 imagemagick_file_formats: Unable to determine gd_version: 2.3.0 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: unknown ### wp-server ### server_architecture: Linux 5.4.0-109-generic x86_64 httpd_software: TasteWP-S4 Official/3.0.0 php_version: 7.4.29 64bit php_sapi: fpm-fcgi max_input_variables: 5000 time_limit: 100 memory_limit: 256M max_input_time: 30 upload_max_filesize: 60M php_post_max_size: 60M curl_version: 7.68.0 OpenSSL/1.1.1f suhosin: false imagick_availability: true pretty_permalinks: false ### wp-database ### extension: mysqli server_version: 8.0.28-0ubuntu0.20.04.3 client_version: mysqlnd 7.4.29 max_allowed_packet: 268435456 max_connections: 1000 ### wp-constants ### WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /s4-lastprison/wordpress/wp-content WP_PLUGIN_DIR: /s4-lastprison/wordpress/wp-content/plugins WP_MEMORY_LIMIT: 96M WP_MAX_MEMORY_LIMIT: 96M WP_DEBUG: true WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: /s4-lastprison/wordpress/debug.log SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: true COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: Undefined DB_CHARSET: utf8mb4 DB_COLLATE: undefined ### wp-filesystem ### wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable ### google-site-kit ### version: 1.79.1 php_version: 7.4.29 wp_version: 6.0.1 reference_url: https://lastprison.s4-tastewp.com amp_mode: no site_status: connected-site user_status: authenticated verification_status: verified-file connected_user_count: 1 active_modules: site-verification, search-console, pagespeed-insights recoverable_modules: none required_scopes: openid: ✅ https://www.googleapis.com/auth/userinfo.profile: ✅ https://www.googleapis.com/auth/userinfo.email: ✅ https://www.googleapis.com/auth/siteverification: ✅ https://www.googleapis.com/auth/webmasters: ✅ capabilities: googlesitekit_authenticate: ✅ googlesitekit_setup: ✅ googlesitekit_view_posts_insights: ✅ googlesitekit_view_dashboard: ✅ googlesitekit_manage_options: ✅ googlesitekit_view_splash: ✅ googlesitekit_view_authenticated_dashboard: ✅ googlesitekit_view_wp_dashboard_widget: ✅ googlesitekit_view_admin_bar_menu: ✅ enabled_features: adsenseSetupV2: ✅ dashboardSharing: ⭕ ga4ActivationBanner: ⭕ ideaHubModule: ⭕ twgModule: ⭕ userInput: ⭕ zeroDataStates: ✅ search_console_property: https://lastprison.s4-tastewp.com/ ```
kuasha420 commented 2 years ago

Status Update

I have investigate this with the JWT Auth plugin active. When the plugin is activated, all WP Rest Routes require Authorization headers in the request to be accessed (except the whitelisted ones). But in the Admin page the API calls are made with the credentials, now JWT Token.

We can't really do anything other than advise JWT Auth users to whitelist the google-site-kit routes using a filter the JWT Auth Plugin provides.

  1. create wp-content/mu-plugins/jwt-auth-whitelist.php with the following content.

    <?php
    /**
    * Whitelist Google Site Kit API calls in JWT Auth by Useful Team.
    */
    add_filter( 'jwt_auth_whitelist', function ( $endpoints ) {
    $your_endpoints = array(
      '/wp-json/google-site-kit/*',
    );
    
    return array_unique( array_merge( $endpoints, $your_endpoints ) );
    } );

In my opinion, the behavior is a bug in the JWT Auth plugin as it shouldn't make cookie authorized requests to fail. And we can definitely raise an issue there.

There's no action to be taken on our side other then suggesting them the above fix.

As for as the error without JWT Plugin, I'm unable to recreate it as well. And other than the impacted user giving us their site credentials, I think there's no way for us to reproduce/investigate their issue.

cc @jamesozzie @bethanylang

jamesozzie commented 2 years ago

Closing this out, with a mini plugin created to make use of the above filter. I've also reached out to the JWT Auth team and contacted all impacted users.

For those impacted, you can use the jwt_auth_whitelist filter above, or download, install and activate the mini plugin as a standard WordPress plugin, in order to ensure Site Kit works alongside JWT Auth.

jamesozzie commented 2 years ago

Just adding here that another user reported this error although in this users case their site was compromised: https://wordpress.org/support/topic/google-site-kit-12/

This user did not use the JWT Auth plugin, and was able to continue using Site Kit after addressing any issues by removing malicious files and using a security plugin to determine any action areas.