dateRangeLength must be a positive integer dashboard error
See original GitHub issueBug Description
There have been recent reports of the below error message, with one user stating this occurs when clicking on the Search console tab.
dateRangeLength must be a positive integer.
in LegacySearchConsoleDashboardWidgetSiteStats
in withData(LegacySearchConsoleDashboardWidgetSiteStats)
in Unknown
in WithSelect(withData(LegacySearchConsoleDashboardWidgetSiteStats))
in div
in Layout
in div
in div
in div
in div
in GoogleSitekitSearchConsoleDashboardWidget
in FilteredComponent
in WithFilters(ModuleApp)
in ModuleApp
in GoogleSitekitModule
in RestoreSnapshots
in ErrorHandler
in Root
- https://wordpress.org/support/topic/site-kit-encountered-an-error-36/ | Open | SH info provided
- https://wordpress.org/support/topic/error-search-google-in-site-kit/ | Open | SH info provided
- https://wordpress.org/support/topic/my-site-kit-has-occured-an-error/ | Open
- https://wordpress.org/support/topic/gsuite-shows-a-error-what-does-it-means | Resolved | SH info within topic | randomly started working as expected once more
- https://wordpress.org/support/topic/error-occur-to-site-kit/#post-14510879 | Open | SH info provided
- https://wordpress.org/support/topic/problem-with-search-console-in-google-site-kit/ | Open
- https://wordpress.org/support/topic/site-kit-encountered-an-error-38/#post-14516532 | Open
Troubleshooting ongoing, looking at the error message provided this looks similar to #3255
</google-sheets-html-origin>Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
extractSearchConsoleDashboardData
should be updated to acceptdateRangeLength
as a parameter rather than inferring this from the length of the data given as it does now- All (4) instances of components using
extractSearchConsoleDashboardData
should be updated to retrieve the current date range length (e.g.getDateRangeNumberOfDays
) to provide to this utility
Implementation Brief
- Merge #3478
Test Coverage
- Add and update tests for changes to
partitionReport
Visual Regression Changes
- Update reference images for Search Console chart due to change in date range (essentially undoes a change in #3348)
QA Brief
- Set up Site Kit using a property that has less-than-full data in Search Console (e.g. added in the last few weeks – @jamesozzie has such a property)
- Check Search Console dashboards (widget + non-widget based)
- Check all date ranges
- For date ranges that touch the maximum age of the property in Search Console (e.g. Last 28 days with the property added in Search Console 25 days ago) any larger date range should show same/similar metrics since larger date ranges include previous
Changelog entry
- Fix potential
dateRangeLength must be a positive integer.
error for Search Console reports with missing dates.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Site Kit encountered an error | WordPress.org
i can see this error message in my wordpress search console dashboard. please help. dateRangeLength must be a positive integer.
Read more >readme.txt - HSDC
Go to the main Site Kit dashboard which already displays key metrics from Search Console. 4. ... Fix potential `dateRangeLength must be a...
Read more >Perceptive Connector for SAP Financials
address in the AS Host box, and the number of instances to connect to SAP servers in ... You need to configure the...
Read more >Public Meeting - East and North Hertfordshire NHS Trust
1 May 2019 at 11.00am at Lister Education Centre. Present: Mrs Ellen Schroder ... Positively, the Trust continued to report zero 12-hour.
Read more >Untitled
Wordpress display admin notice, Past winning powerball jackpot numbers, Seth curry golden ... Cherub right where we should be, Fresh market working hours, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Hazlitte Just a side note:
LegacySearchConsoleDashboardWidgetSiteStats
seems to check if the report is empty:https://github.com/google/site-kit-wp/blob/045409d71d8f36315f97a0d47f49d39fcb9bdf0c/assets/js/modules/search-console/components/dashboard/LegacySearchConsoleDashboardWidgetSiteStats.js#L117-L119
Once the
widgets.moduleScreens
feature is turned on and we stop using the legacy widgets, we will still be callingextractSearchConsoleDashboardData
:https://github.com/google/site-kit-wp/blob/045409d71d8f36315f97a0d47f49d39fcb9bdf0c/assets/js/modules/search-console/components/module/ModuleOverviewWidget/Overview.js#L45-L47
In that scenario too, empty reports seem to be caught (via
isZeroReport
).That was why I thought it might only be reports of length 1 that cause this issue. Thought it might be worth pointing out.
Either way, your
> 2
fix suggestion would work, I think.Additional 2 reports added to issue description. No common plugins or obvious cause so far, all 3 sites do have a migration or demo content importer plugins active. Troubleshooting ongoing,