site-kit-wp: Cannot read properties of null (reading '0')
Bug Description
New report of ‘Cannot read properties of null (reading ‘0’)’ error message displayed in Site Kit. This has been reported twice previously with no user insights.
Recent topic: https://wordpress.org/support/topic/google-site-kit-configuration-problem-2/ Site Health: https://docs.google.com/forms/d/1lhjns2K7c0Ny7ME4gxTcsnYtNUtcMr8BvFpPQi23Y1E/edit#response=ACYDBNj60XTXxmiJSJuvu9ySD9P--oMGLlVuonUvlAMLdf5vFEecsgh7zQq9P81s-piSKbM
Previously closed topics: https://wordpress.org/support/topic/error-on-analytics-tab/ https://wordpress.org/support/topic/cannot-read-properties-of-null-reading-0/
Error message:
Cannot read properties of null (reading '0')
in Stats
in div
in div
in Widget
in WithWidgetSlug(Widget)
in ModuleOverviewWidget
in WidgetRenderer
in div
in Cell
in WidgetCellWrapper
in div
in Row
in div
in div
in ForwardRef
in WidgetAreaRenderer
in div
in WidgetContextRenderer
in ModuleApp
in GoogleSitekitModule
in RestoreSnapshots
in ErrorHandler
in Root
Insights & Troubleshooting Checks performed
- Health Check & Troubleshooting plugin check
- Front end check (mixed content, minified content, combined JS)
- Incognito mode
- Checked users Site Health info, no identified causes
- Additional .htaccess rules applied (no in 1 case, yes in another)
- Uninstalled and reinstalled plugin
- User confirmed no “Critical errors” in their Site Health status
- Attempted setup/viewing dashboards from another device
- Temporary disabled WAF rules at host level - including ModSecurity
- Checked site setup and dashboard from another WordPress site on the same hosting platform
- Reset Site Kit
- Reset Site records (on the SK service)
- Checked does the same occur when selecting a different Google account during OAuth setup
- Checked setup using another WordPress administrator account
- Reviewed error logs
Steps to reproduce
Unable to reproduce so far.
Screenshots
N/A
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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21
Thank you so much, @kuasha420! @jamesozzie @adamdunnage Seems like good info to add to the wiki, perhaps? I’ll close this issue out, but please do let us know if you have any other questions.
One user, who reported this error has shared the Nginx configurations they applied in order to resolve this. This user compared the difference in their Nginx block on a site that did connect successfully to that which encountered the error.
Old Ngix block configuration, which resulted in the error:
New Ngix block configuration, no errors:
Update on this:
I’ve went through all the information available in this thread and was able to reproduce the issue. However, Most of the successful reproducing involved intentionally messing with server configuration in the following steps.
GET:reportrequests with all the query parameters produces large URL strings, if the server strips the URL before it’s passed to the PHP process, the error can happen. This is also likely to happen with misconfigured Nginx server.Unfortunately, we can’t do anything in plugin site to mitigate this issue since the cause of it is server specific for most cases.
There are many ways to configure nginx server for WordPress so if an user is having this issue on a nginx server they’ve configured, we can provide them with the minimum nginx config to compare.
Other than this, since
SearchConsoleStatsis known to cause this error, we can explore putting an error boundary around it. I’ll file a issue for it.Cheers.
cc @jamesozzie @aaemnnosttv @bethanylang
To close the loop here, @eugene-manuilov did not find anything obvious in the user-provided nginx config file, so we’ve let them know that this is likely a hosting issue but it will require deeper troubleshooting from a developer as it’s not Site Kit-specific support.
Keeping this issue open for now for investigation of any future reports.