organic-search-analytics
organic-search-analytics copied to clipboard
bug in the latest version: No records found in reports
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".
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.
- all upgrade scripts run correctly with "OK"
- data exists as checked directly in MySQL DB (188k rows)
- config is OK as the tool works
- domain records match as nothing has been changed in the meantime
Also, I think this bug is related to #60
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.
Failed upgrade script was the cause, after manual DB upgrade everything works now. See #61