organic-search-analytics icon indicating copy to clipboard operation
organic-search-analytics copied to clipboard

bug in the latest version: No records found in reports

Open nekromoff opened this issue 8 years ago • 4 comments
trafficstars

After upgrading both the codebase and the database (step after step from 2.4.3), the saved quick links reports don't work. They just show "No records found".

Also, any other tries to get reports for previously saved data (136 days) are showing "No records found".

nekromoff avatar May 23 '17 09:05 nekromoff

I just released an updated version - 2.5.4 that fixes some bugs on the report pages. I'm not certain that version would address this issue, but I'd still suggest using the most recent version at all times (as it should be the best and most stable version).

I'd ensure you ran the upgrade scripts (found from the homepage) in order to get your database up to date with what the codebase expects.

The next step I'd take is to verify that the data exists in the database using PHPMyAdmin or MySQL Workbench. Maybe something in the upgrade process mucked with the database?

If the data is in the database, ensure that the configuration settings are set to use that database.

If all that looks good, then I'd verify that the domain for the records in the database 100% matches that in Google Search Console.

Those are the first steps I'd take in troubleshooting this.

PromInc avatar May 26 '17 02:05 PromInc

  1. all upgrade scripts run correctly with "OK"
  2. data exists as checked directly in MySQL DB (188k rows)
  3. config is OK as the tool works
  4. domain records match as nothing has been changed in the meantime

Also, I think this bug is related to #60

nekromoff avatar May 28 '17 11:05 nekromoff

OK, so the issue seem to be this: This line: https://github.com/PromInc/organic-search-analytics/blob/master/organic-search-analytics/report.php#L109

gets this query:

SELECT query, count(query) as 'queries', count(DISTINCT page) as 'pages', sum(impressions) as 'impressions', sum(clicks) as 'clicks', sum(avg_position*impressions)/sum(impressions) as 'avg_position', avg(ctr) as 'ctr' FROM search_analytics WHERE domain = 'http://example.com/' AND date >= '2017-01-01' AND date <= '2017-05-17' GROUP BY query ORDER BY clicks ASC 

and MySQL shows this error when tried via phpMyAdmin:

#1054 - Unknown column 'page' in 'field list'

and thus the report fails.

nekromoff avatar May 28 '17 11:05 nekromoff

Failed upgrade script was the cause, after manual DB upgrade everything works now. See #61

nekromoff avatar May 28 '17 12:05 nekromoff