question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dateRangeLength must be a positive integer dashboard error

See original GitHub issue

Bug 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

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 accept dateRangeLength 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

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
johnPhillipscommented, Jun 3, 2021

@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 calling extractSearchConsoleDashboardData:

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.

1reaction
jamesozziecommented, May 28, 2021

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,

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found